packages feed

sbv-13.0: SBVTestSuite/TestSuite/CompileTests/SCase/SCase24.hs

{-# LANGUAGE QuasiQuotes #-}

{-# OPTIONS_GHC -Wall -Werror #-}

module T where

import Expr
import Data.SBV

t :: SExpr -> SInteger
t e = [sCase|Expr e of
               Zero           -> 0
               Num _          -> 4
               Var s          -> ite (s .== literal "a") 1 2
               Add a b | t a .== 4 -> t b
               Let _   _a  b  -> t b
               _ -> 2
      |]