File: multiline-forall.hs

package info (click to toggle)
haskell-ormolu 0.8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,932 kB
  • sloc: haskell: 17,183; makefile: 3
file content (46 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (4)
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
41
42
43
44
45
46
{-# LANGUAGE RankNTypes, PolyKinds, GADTs, TypeFamilies #-}

-- Multiline foralls are consistent across all declarations

data D =
  forall
    (f ::
     * -> * -> *)
    (x :: *)
    (y :: *)
  . D (f x y)

data G where
  G :: forall
         (f ::
          * -> * -> *)
         (x :: *)
         (y :: *)
     . f x y -> G

f :: forall
       (f ::
        * -> * -> *)
       (x :: *)
       (y :: *)
   . f x y -> ()
f = const ()

type family T f x y where
  forall
    (f ::
     * -> * -> *)
    (x :: *)
    (y :: *)
    . T f x y = f x y

{-# RULES
  "r"
  forall
    (f ::
     * -> * -> *)
    (x :: *)
    (y :: *)
  . r (a :: f x y) =
    ()
  #-}