Idris2-boot/tests/idris2/perf003/Auto.idr
Edwin Brady 663e1b8f69 Add uniqueSearch data type option
This changes the behaviour of 'auto' implicits so that by default they
return the first result, rather than checking for unique results. This
is consistent with Idris 1. However, we still want to check for
uniqueness somtimes (for example, with interface search, which should
reject overlapping results) so the 'uniqueSearch' option means that any
auto implicit search for the type should check uniqueness of results.

Fixes #169
2019-12-07 18:54:02 +00:00

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