70 likes | 147 Views
600.429 FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES. Dr. John Peterson Western State Colorado University. Project Pitch. A detailed project pitch will be due next Wednesday. I’ll need to know: Style of implementation Infrastructure Sample code
E N D
600.429FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University
Project Pitch A detailed project pitch will be due next Wednesday. I’ll need to know: • Style of implementation • Infrastructure • Sample code • If embedded in Haskell, type signatures • Implementation plan
Homework Any questions? The next homework will expand on the current one. What is the overall organization of the code? How do you glue together parser
Inside parsec See http://hackage.haskell.org/package/parsec Let’s look at “Char”, “Combinator”, and “Prim” How can we make combinators similar to those in Char with an arbitrary token stream type?
Functor fmap :: Functor f => (a -> b) -> (f a -> f b) (<$>) = fmap fmap f m = do r <- m return (f r)
Applicative f <*> g = do f1 <- f g1 <- g return $ f1 g1 f <* g = do r <- f g return r
Pretty Printing See http://hackage.haskell.org/packages/archive/pretty/1.1.1.0/doc/html/Text-PrettyPrint.html