-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtuples.hs
29 lines (26 loc) · 958 Bytes
/
tuples.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Test.Speculate
import Data.Tuple
right :: (a,b,c) -> (c,a,b)
right (x,y,z) = (z,x,y)
left :: (a,b,c) -> (b,c,a)
left (x,y,z) = (y,z,x)
main :: IO ()
main = speculate args
{ maxSemiSize = 0
, maxVars = 3
, instances = [ reifyInstances (int,int,int) ]
, constants =
[ showConstant (() :: ())
, constant "id" (id :: () -> ())
, constant "id" (id :: Int -> Int)
, constant "id" (id :: (Int,Int) -> (Int,Int))
, constant "id" (id :: (Int,Int,Int) -> (Int,Int,Int))
, constant "," ((,) :: Int -> Int -> (Int,Int))
, constant ",," ((,,) :: Int -> Int -> Int -> (Int,Int,Int))
, constant "fst" (fst :: (Int,Int) -> Int)
, constant "snd" (snd :: (Int,Int) -> Int)
, constant "swap" (swap :: (Int,Int) -> (Int,Int))
, constant "right" (right :: (Int,Int,Int) -> (Int,Int,Int))
, constant "left" (left :: (Int,Int,Int) -> (Int,Int,Int))
]
}