File: Vta2.hs

package info (click to toggle)
haskell-src-exts 1.23.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,852 kB
  • sloc: haskell: 13,707; makefile: 12
file content (14 lines) | stat: -rw-r--r-- 398 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE RankNTypes, TypeApplications #-}


module Vta2 where

checkIf :: Bool -> (forall a. a -> a) -> (Bool, Int)
checkIf _ = if True
            then \f -> (f True, f 5)
            else \f -> (f False, f @Int 3)

checkCase :: Bool -> (forall a. a -> a) -> (Bool, Int)
checkCase _ = case True of
                True -> \f -> (f True, f 5)
                False -> \f -> (f False, f @Int 3)