
11 Nov
2014
11 Nov
'14
7:48 p.m.
Karl Voelker
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} module FS where
type Date = String
data FileKind = FILE | FOLDER
data Entry (k :: FileKind) where File :: String -> Date -> Int -> Entry FILE Folder :: String -> String -> Entry FOLDER
This is a little beyond my Haskell knowledge. What would the function signatures look like? Here are my guesses: listFolder :: Path -> [Entry ?] createFolder :: Path -> Entry FOLDER createFile :: Path -> Entry FOLDER Also, lets say I wanted to just get the "id" fields from a list of `Entry` values. Can someone help me fill in the blanks here? l :: [Entry ?] let ids = map (?) l