File: MultiWayIf.hs.prettyprinter.golden

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 (33 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (5)
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
{-# LANGUAGE MultiWayIf #-}
module MultiWayIf where
foo
  = if | test1 -> e1
       | test2 witharg -> e2
       | otherwise -> def
bar
  = if | test1 ->
         if | test2 -> e1
            | test3 -> e2
       | test4 -> e3
x = 10
x1
  = if | x < 10 -> "< 10"
       | otherwise -> ""
x2
  = if | x < 10 -> "< 10"
       | otherwise -> ""
x3
  = if | x < 10 -> "< 10"
       | otherwise -> ""
x4 = if | True -> "yes"
x5
  = if | True ->
         if | False -> 1
            | True -> 2
x6
  = if | x < 10 ->
         if | True -> "yes"
            | False -> "no"
       | otherwise -> "maybe"
x7 = (if | True -> 0)
spam = if | () <- () -> ()