Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo60 committed Mar 26, 2014
1 parent 3b0b85e commit 88270a0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
49 changes: 23 additions & 26 deletions frege/data/NanoParsec.fr
Original file line number Diff line number Diff line change
Expand Up @@ -520,30 +520,27 @@ prop_count_0 = allParsers (\p ->
prop_count_1 = allParsers (\p ->
count 1 p `same` fmap return p)

private main = do
-- parseTest (skip $ letter >> letter) ['Q']
-- parseTest (many $ letter >> letter) ['Q']
-- parseTest (skip $ letter >> pany >> letter) ['x', 'o']
-- parseTest ((many $ letter >> pany >> letter) >> return ()) ['x', 'o']
parseTest rec (unpacked "(a,)")
parseTest rec (unpacked "(a,b)")
-- parseTest rec (unpacked "abc")
parseTest rec (unpacked "()")
parseTest rec (unpacked "0(a,)")
parseTest rec (unpacked "1(a,b)")
-- parseTest rec (unpacked "2abc")
parseTest rec (unpacked "3()")
parseTest rec (unpacked "4super")
parseTest rec (unpacked "4,super")
parseTest rec (unpacked "(a;)")
parseTest rec (unpacked "5(a;)")
where
ident = many letter

rec :: Parser [] Char [Char]
rec = between (expect '(') (expect ')') (letter `sepEndBy` (expect ','))
<|> (digit >> rec)
-- private main = do
-- -- parseTest (skip $ letter >> letter) ['Q']
-- -- parseTest (many $ letter >> letter) ['Q']
-- -- parseTest (skip $ letter >> pany >> letter) ['x', 'o']
-- -- parseTest ((many $ letter >> pany >> letter) >> return ()) ['x', 'o']
-- parseTest rec (unpacked "(a,)")
-- parseTest rec (unpacked "(a,b)")
-- -- parseTest rec (unpacked "abc")
-- parseTest rec (unpacked "()")
-- parseTest rec (unpacked "0(a,)")
-- parseTest rec (unpacked "1(a,b)")
-- -- parseTest rec (unpacked "2abc")
-- parseTest rec (unpacked "3()")
-- parseTest rec (unpacked "4super")
-- parseTest rec (unpacked "4,super")
-- parseTest rec (unpacked "(a;)")
-- parseTest rec (unpacked "5(a;)")
-- where
-- ident = many letter
--
-- rec :: Parser [] Char [Char]
-- rec = between (expect '(') (expect ')') (letter `sepEndBy` (expect ','))
-- <|> (digit >> rec)
-- <|> many letter

-- parseTest (between (expect '[') (expect ']') $ ident `sepEndBy` expect ',') "[,]"

8 changes: 6 additions & 2 deletions frege/lib/Modules.fr
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ walkThing arg = do
-- `catch` cnf
`catch` fnf
where
cnf (ex::ClassNotFoundException) = return []
-- cnf (ex::ClassNotFoundException) = return []
fnf (ex::FileNotFoundException) = do
stderr.println ("Could not walk " ++ ex.getMessage)
return []
Expand All @@ -131,7 +131,8 @@ main args = do
data RTree a = T (Tree String a) | R String

instance Functor RTree where
fmap f (T t) = T $ fmap f t
fmap f (T t) = T $ fmap f t
fmap f (R r) = R r

data Y f = Y (f (Y f))

Expand All @@ -148,6 +149,9 @@ pack p ((s:ss), fp) = case out p of
T x -> case lookup x s of
Just p' -> Y $ T $ update x s (pack p' (ss, fp))
Nothing -> Y $ T $ insert x s (pack noPacks (ss, fp))
R _ -> p -- this is bad, should be a directory, but is module

pack p ([], _) = p

pfind [] p = Just p
pfind (s:ss) p = case out p of
Expand Down

0 comments on commit 88270a0

Please sign in to comment.