mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2025-01-06 04:16:38 +03:00
663e1b8f69
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
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
|