04:14:06 <pyro-> hello! terrible noob question if anyone has the time. basically i haven't learnt haskell well enough to interpret the type error yet. how do i join serveDirectory with the rest of my routes? ghc complains about msum [dir "test" $ ok "test", dir "static" $ serveDirectory ...]
04:16:59 <stepkut``> that looks correct, maybe you are missing an argument to serveDirectory?
04:17:07 <stepkut``> oh
04:17:54 <stepkut> ok "test" has the type 'ServerPart String' -- which is fine by itself because there is a ToMessage instance for String
04:18:19 <stepkut> but serveDirectory has the return type 'ServerPart Response' -- so the two parts don't match
04:18:35 <stepkut> your best option is to make everything be 'ServerPart Response', you can do that by adding a toResponse
04:18:41 <stepkut> ok $ toResponse "test"
04:19:19 <stepkut> if you have the OverloadedStrings extension enabled then it will not know if "test" should be treated as String, Text, or something else, you might need, ok $ toResponse ("ok" :: Text), in that case
04:20:24 <pyro-> stepkut: thank you very much. that has fixed it and makes perfect sense
04:21:44 <pyro-> i have given up trying to understand haskell type system outside of practice, so i am going to build a website :D
04:22:07 <pyro-> i come from scheme land and find haskell types difficult
04:24:18 <stepkut> excellent!
04:27:43 <pyro-> i tried serverDirectory and test seperately, and they worked. the problem was that i was creating a non homogeonous list, right?
04:28:41 <stepkut> yes
04:29:01 <pyro-> thank you
04:29:50 <stepkut> no problem!