Created
May 9, 2018 13:36
-
-
Save canonic-epicure/72b51d7bda1ab411099825bfb4d1077d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Language | |
%default total | |
mutual | |
data QuerySource : Type where | |
Table : (tableName : String) -> QuerySource | |
SubQuery : Bool -> QuerySource | |
As : (source : QuerySource) -> {auto prf : QuerySourceIsNotAliased source} -> (aliasName : String) -> QuerySource | |
data QuerySourceIsNotAliased : QuerySource -> Type where | |
BecauseItIsTable : QuerySourceIsNotAliased (Table tableName) | |
BecauseItIsSubquery : QuerySourceIsNotAliased (SubQuery query) | |
some : QuerySource | |
some = Table "name" `As` "n" | |
{- | |
*Playground> :l Test2.i | |
/home/nickolay/workspace/Idris/horn/src/Test2.idr:18:1-28: | |
| | |
18 | some = Table "name" `As` "n" | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Language.some is possibly not total due to: Language.BecauseItIsTable | |
*Test2> | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment