blob: bd79f1e63b11d39ad3f18d882e6ec2b10bb2406e (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
|
{-# LANGUAGE PatternSynonyms #-}
module Sigs where
-- TypeSig
f :: Num a => a -> a
f = undefined
pattern Single :: () => (Show a) => a -> [a]
pattern Single x = [x]
g :: (Show a) => [a] -> a
g (Single x) = x
-- Fixities
infixr 6 +++
infixr 7 ***,///
(+++) :: Int -> Int -> Int
a +++ b = a + 2*b
(***) :: Int -> Int -> Int
a *** b = a - 4*b
(///) :: Int -> Int -> Int
a /// b = 2*a - 3*b
-- Inline signatures
{-# Inline g #-}
{-# INLINE [~34] f #-}
-- Specialise signature
-- Multiple sigs
x,y,z :: Int
x = 0
y = 0
z = 0
|