Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |||build a type signature out of a list of types
- ||| e.g.: `ListToSig [String, Int, Int]` returns String -> Int -> Int -> String
- ListToSig : List Type -> Type
- ListToSig [] = String
- ListToSig (x :: xs) = x -> ListToSig xs
- ||| returns a function that builds a string from the arguments given to it
- ||| e.g.: `listToFunc [(String, show), (Int, show)] ""` returns a function f : String -> Int -> String
- ||| and when applied with input `f "hello" 3` gives "hello.3."
- listToFunc : {t : Type} -> (l : List (t, t -> String)) -> String -> ListToSig (map fst l)
- listToFunc [] x = x
- listToFunc ((a, f) :: xs) x = \arg => listToFunc xs ((f arg) ++ "." ++ x))
Add Comment
Please, Sign In to add comment