packages feed

sbv-14.0: SBVTestSuite/TestSuite/CompileTests/PCase/PCase66.hs

{-# LANGUAGE QuasiQuotes         #-}
{-# LANGUAGE DataKinds           #-}
{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeAbstractions    #-}
{-# LANGUAGE TypeApplications    #-}

{-# OPTIONS_GHC -Wall -Werror -ddump-splices #-}

-- Test: pCase with List, guards and wildcard
module T where

import Prelude hiding (null, head, tail)
import Data.SBV
import Data.SBV.TP

t :: TP (Proof (Forall "xs" [Integer] -> SBool))
t = calc "t" (\(Forall @"xs" (xs :: SList Integer)) -> xs .== xs) $ \xs -> []
    |- [pCase| xs of
         []             -> xs .== xs =: qed
         y : _ | y .> 0 -> xs .== xs =: qed
         _              -> xs .== xs =: qed
       |]