mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-22 11:13:36 +03:00
19 lines
516 B
Idris
19 lines
516 B
Idris
|
public export
|
||
|
data Phase = Gas | Liquid | Solid
|
||
|
|
||
|
public export
|
||
|
data ChangePhase : Phase -> Phase -> Type where
|
||
|
Sequence : ChangePhase a b -> ChangePhase b c -> ChangePhase a c
|
||
|
Condense : ChangePhase Gas Liquid
|
||
|
Freeze : ChangePhase Liquid Solid
|
||
|
Melt : ChangePhase Solid Liquid
|
||
|
Vaporize : ChangePhase Liquid Gas
|
||
|
Sublimate : ChangePhase Solid Gas
|
||
|
|
||
|
public export
|
||
|
inferred : { auto transition : ChangePhase l r } -> ChangePhase l r
|
||
|
inferred { transition } = transition
|
||
|
|
||
|
test : ChangePhase Gas Solid
|
||
|
test = inferred
|