Helper functions for producing Haskell code
- class HaskellType a where
- haskellType :: a -> String
- class HaskellValue a where
- haskellValue :: a -> String
- unlinesNoTrail :: [String] -> String
- indent :: Int -> String -> String
- newline :: String
- (-$-) :: HaskellValue a => String -> a -> String
- opApp :: (HaskellValue a, HaskellValue b) => String -> a -> b -> String
- (-=-) :: (HaskellValue patt, HaskellValue def) => patt -> def -> String
- local :: String -> String -> String
- ifThenElse :: (HaskellValue c, HaskellValue t, HaskellValue e) => c -> t -> e -> String
Documentation
class HaskellType a whereSource
Types that can represent Haskell types (as source code strings)
haskellType :: a -> StringSource
Gives the Haskell type denoted by the argument.
class HaskellValue a whereSource
Types that can represent Haskell values (as source code strings)
haskellValue :: a -> StringSource
Gives the Haskell code denoted by the argument.
unlinesNoTrail :: [String] -> StringSource
Like unlines
, but no trailing '\n'
.
(-$-) :: HaskellValue a => String -> a -> StringSource
Application
opApp :: (HaskellValue a, HaskellValue b) => String -> a -> b -> StringSource
Binary operator application
(-=-) :: (HaskellValue patt, HaskellValue def) => patt -> def -> StringSource
Definition
ifThenElse :: (HaskellValue c, HaskellValue t, HaskellValue e) => c -> t -> e -> StringSource