I'm wondering if it's possible to do some sort of dependent typing like the following in Elm, like you can in Idris:
isQuestion : String -> Type
isQuestion (sentence) with (endsWith "?" sentence)
| True = Question
| False = Statement
Is there a library that will let me achieve a similar effect via typing?