packages feed

aihc-parser-1.0.0.2: test/Test/Fixtures/oracle/PatternSynonyms/pattern-synonyms-complete-pragma.hs

{- ORACLE_TEST pass -}
{-# LANGUAGE PatternSynonyms #-}

module PatternSynonymsCompletePragma where

data Nat = Z | S Nat

pattern Zero :: Nat
pattern Zero = Z

pattern Succ :: Nat -> Nat
pattern Succ n = S n

{-# COMPLETE Zero, Succ #-}

toInt :: Nat -> Int
toInt Zero = 0
toInt (Succ n) = 1 + toInt n