Idris2/tests/idris2/misc/docs004/List.idr
André Videla 75032a7164
Emit warning for fixities with no export modifiers (#3234)
* Emit warning for fixities with no export modifiers

This is to help update all the existing code to program with explicit
fixity export directives in preparation for the behavioral change where
they will become private by default.
2024-04-03 15:41:57 +01:00

20 lines
359 B
Idris

module List
data List a = Nil | (::) a (List a)
export infixr 5 ::
export infixr 5 ++
interface Monoid ty where
||| Users can hand-craft their own monoid implementations
constructor MkMonoid
neutral : ty
(++) : ty -> ty -> ty
Monoid (List a) where
neutral = []
xs ++ ys = case xs of
[] => ys
(x :: xs) => let ih = xs ++ ys in x :: ih