Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (10 sloc) 0.386 kB
data FuncRec = FuncRec {
name :: String, calc :: Int -> Int, namedCalc :: Int -> (String, Int)
}
mkFuncRec :: String -> (Int -> Int) -> FuncRec
mkFuncRec name calcfunc = FuncRec {
name = name, calc = calcfunc,
namedCalc = \x -> (name, calcfunc x)
}
plus5 = mkFuncRec "plus5" (+ 5)
always0 = mkFuncRec "always0" $ const 0
Jump to Line
Something went wrong with that request. Please try again.