Author dan
 Title example 4
 Created at Sat Oct 19 07:29:15 UTC 2013
{-# LANGUAGE DeriveGeneric #-}
module Main where
import GHC.Generics
import Diagrams.Interactive
        
data Foo = Bar String | Baz Int Int
           deriving (Show, Generic)

instance Input Foo
instance Output Foo
instance Display Foo

example :: Foo -> Int
example (Bar s)   = length s
example (Baz i j) = i + j

main = return ()
Result

Loading...

Warning
Top-level binding with no type signature: main :: IO ()