Skip to content

Commit

Permalink
Add FlexibleContexts extension to allow explicit type defintions for …
Browse files Browse the repository at this point in the history
…yaml functions.
  • Loading branch information
xaviershay committed Jul 10, 2011
1 parent 0bef579 commit a7db697
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Xtdo.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- FlexibleContexts needed for explicit type declarations on YAML functions
{-# LANGUAGE FlexibleContexts #-}

module Xtdo where
import System.Environment
import System.Console.ANSI
Expand Down Expand Up @@ -238,9 +241,9 @@ loadYaml = do
recurring <- mapM extractRecurring recurSequence
return ProgramData {tasks=tasks,recurring=recurring}

--extractRecurring
-- :: (Failure ObjectExtractError m) =>
-- Object String String -> m RecurringTaskDefinition
extractRecurring
:: (Failure ObjectExtractError m) =>
StringObject -> m RecurringTaskDefinition
extractRecurring x = do
m <- fromMapping x
n <- lookupScalar "templateName" m
Expand All @@ -260,8 +263,8 @@ parseDay x =
unwrapDay (Just x) = x


--extractTask
-- :: (Failure ObjectExtractError m) => Object String String -> m Task
extractTask
:: (Failure ObjectExtractError m) => StringObject -> m Task
extractTask task = do
m <- fromMapping task
n <- lookupScalar "name" m
Expand Down

0 comments on commit a7db697

Please sign in to comment.