1
1
mirror of https://github.com/idris-lang/Idris2.git synced 2024-12-21 10:41:59 +03:00
Idris2/tests/idris2/reg016/Using.idr
Edwin Brady a972778eab Add test script
They don't all pass yet, for minor reasons. Coming shortly...
Unfortunately the startup overhead for chez is really noticeable here!
2020-05-19 18:25:18 +01:00

22 lines
482 B
Idris

module Using
interface MagmaT a where
op: a -> a -> a
interface MagmaT a => SemigroupT a where
assoc: (x, y, z: a) -> (x `op` y) `op` z = x `op` (y `op` z)
[NamedMagma1] MagmaT Bool where
False `op` False = False
_ `op` _ = True
[NamedMagma2] MagmaT Bool where
True `op` True = True
_ `op` _ = False
[NamedSemigroup1] SemigroupT Bool using NamedMagma1 where
assoc = ?hole1
[NamedSemigroup2] SemigroupT Bool using NamedMagma2 where
assoc = ?hole2