Skip to content
Browse files

* Readme work

* Cleanup + hlint
  • Loading branch information...
1 parent 9baca12 commit 3c46e59d5de8025ee0e84de24808a48838b535ec @spockz spockz committed Oct 15, 2011
Showing with 18 additions and 32 deletions.
  1. +8 −0 README.asciidoc
  2. +3 −7 src/Data/String/Utils.hs
  3. +7 −25 src/Literate/Haskell.hs
View
8 README.asciidoc
@@ -158,6 +158,14 @@ KNOWN ISSUES
CHANGES
-------
+0.1.4.5::
+ * Added support for recursively traversing includes of .lhs files
+ * The program now doesn't fail completely when haskell-src-exts fails to parse
+ a file. An error is reported and the program continues. :) A fmt file is
+ still generated.
+ * Removed a faulty command from the list.
+ * Added a new url.
+ * Cleaned up some code. (Probably introduced other ugly code)
0.1.4.2::
* Removed trace statement
0.1.4.1::
View
10 src/Data/String/Utils.hs
@@ -4,21 +4,17 @@ rtrim :: String -> String -> String
rtrim chars inp = rtrim' inp
where
rtrim' "" = []
- rtrim' [x] = case elem x chars of
- True -> []
- False -> [x]
+ rtrim' [x] = if x `elem` chars then [] else [x]
rtrim' (x:xs) = let tail = rtrim' xs
in
case tail of
- [] -> case elem x chars of
- True -> []
- False -> [x]
+ [] -> if x `elem` chars then [] else [x]
xs -> x : tail
ltrim :: String -> String -> String
ltrim chars = ltrim'
where ltrim' s = case s of
[] -> []
- (x:xs) -> if elem x chars
+ (x:xs) -> if x `elem` chars
then ltrim' xs
else s
View
32 src/Literate/Haskell.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
-module Literate.Haskell (runHaskell, mapping, fromParse) where
+module Literate.Haskell (runHaskell, mapping) where
import Data.List (nub)
import Data.Maybe
@@ -56,7 +56,7 @@ searchTypes (TyCon n) = [Type (prettyPrint n)]
searchTypes _ = []
searchConDecl :: ItemQuery ConDecl
-searchConDecl (ConDecl (i) _) = [Constructor $ prettyPrint i]
+searchConDecl (ConDecl i _) = [Constructor $ prettyPrint i]
searchConDecl (InfixConDecl _ i _) = [Constructor $ prettyPrint i]
searchConDecl (RecDecl i _) = [Constructor $ prettyPrint i]
@@ -71,7 +71,7 @@ searchExp (InfixApp _ qop _) = [Operator $ prettyPrint qop]
searchExp _ = []
searchMat :: ItemQuery Match
-searchMat (Match _ (i) _ _ _ _) = [Function $ prettyPrint i]
+searchMat (Match _ i _ _ _ _) = [Function $ prettyPrint i]
searchDecl :: ItemQuery Decl
searchDecl (TypeSig _ names t) = case t of
@@ -144,25 +144,7 @@ mtypes :: SimpleInfo -> [(String, String)]
mtypes SimpleInfo{types} = map dp types
moperators SimpleInfo{operators} = map (\ a -> (a, "\\ \\mathbin{"++ makeLatexSafe a++"}\\ "))
operators
-mconstructors SimpleInfo{constructors} = map (dp) constructors
-mfunctions SimpleInfo{functions } = map (dp) functions
-mclasses SimpleInfo{classes} = map (dp) classes
-mconstants SimpleInfo{constants} = map (dp) constants
-
-
-
-fooz = [4, 13, 42]
-douz = [4.0, 13.0, 42.0]
-
-
-
-(<++>) :: a -> b -> a
-(<++>) a b = a
-
-tid :: Typeable a => a -> a
-tid = id
-
-
-fromParse (ParseOk m) = m
-
-
+mconstructors SimpleInfo{constructors} = map dp constructors
+mfunctions SimpleInfo{functions } = map dp functions
+mclasses SimpleInfo{classes} = map dp classes
+mconstants SimpleInfo{constants} = map dp constants

0 comments on commit 3c46e59

Please sign in to comment.
Something went wrong with that request. Please try again.