Ticket #5565: session-2.txt

File session-2.txt, 8.3 KB (added by porges, 2 years ago)

my ghci session

Line 
1                  -> Word16
2                  -> Word16
3                  -> Word16
4                  -> IPv6Address'
5    has only 8
6    In the first argument of `print', namely
7      `(IPv6Address 1 0 0 1 0 0 0 1 0)'
8    In the expression: print (IPv6Address 1 0 0 1 0 0 0 1 0)
9    In an equation for `it': it = print (IPv6Address 1 0 0 1 0 0 0 1 0)
10*Main> print (IPv6Address 1 0 0 1 0 0 0 1)
111:::1:::1
12*Main> :r
13[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
14Ok, modules loaded: Main.
15*Main> print (IPv6Address 1 0 0 1 0 0 0 1)
161::1::1
17*Main> let longestZeroSeq parts = groupBy ((==) `on` fst) zip parts [0..]
18
19<interactive>:1:42: Not in scope: `on'
20*Main> import Data.Function
21*Main Data.Function> let longestZeroSeq parts = groupBy ((==) `on` fst) zip part
22s [0..]
23
24<interactive>:1:28:
25    The function `groupBy' is applied to four arguments,
26    but its type `(a0 -> a0 -> Bool) -> [a0] -> [[a0]]' has only two
27    In the expression: groupBy ((==) `on` fst) zip parts [0 .. ]
28    In an equation for `longestZeroSeq':
29        longestZeroSeq parts = groupBy ((==) `on` fst) zip parts [0 .. ]
30*Main Data.Function> let longestZeroSeq parts = groupBy ((==) `on` fst) (zip par
31ts [0..])
32*Main Data.Function> longestZeroSeq [1,2,0,0,0,1,0,0,2,0,0,0,0]
33[[(1,0)],[(2,1)],[(0,2),(0,3),(0,4)],[(1,5)],[(0,6),(0,7)],[(2,8)],[(0,9),(0,10)
34,(0,11),(0,12)]]
35*Main Data.Function> longestZeroSeq = fst $ maxBy length $ filter ((==0) . fst .
36 head) $ groupBy ((==) `on` fst) $ zip parts [0..]
37
38<interactive>:1:16: parse error on input `='
39*Main Data.Function> let longestZeroSeq = fst $ maxBy length $ filter ((==0) . f
40st . head) $ groupBy ((==) `on` fst) $ zip parts [0..]
41
42<interactive>:1:28: Not in scope: `maxBy'
43
44<interactive>:1:103: Not in scope: `parts'
45*Main Data.Function> let longestZeroSeq parts = fst $ maximumBy length $ filter
46((==0) . fst . head) $ groupBy ((==) `on` fst) $ zip parts [0..]
47
48<interactive>:1:44:
49    Couldn't match expected type `[a0] -> Ordering'
50                with actual type `Int'
51    Expected type: [a0] -> [a0] -> Ordering
52      Actual type: [a0] -> Int
53    In the first argument of `maximumBy', namely `length'
54    In the expression: maximumBy length
55*Main Data.Function> let longestZeroSeq parts = fst $ maximumBy (comparing.lengt
56h) $ filter ((==0) . fst . head) $ groupBy ((==) `on` fst) $ zip parts [0..]
57
58<interactive>:1:45: Not in scope: `comparing'
59*Main Data.Function> import Data.List
60*Main Data.Function Data.List> let longestZeroSeq parts = fst $ maximumBy (compa
61ring.length) $ filter ((==0) . fst . head) $ groupBy ((==) `on` fst) $ zip parts
62 [0..]
63
64<interactive>:1:45: Not in scope: `comparing'
65*Main Data.Function Data.List> import Data.Ord
66*Main Data.Function Data.List Data.Ord> let longestZeroSeq parts = fst $ maximum
67By (comparing.length) $ filter ((==0) . fst . head) $ groupBy ((==) `on` fst) $
68zip parts [0..]
69
70<interactive>:1:45:
71    Couldn't match expected type `Ordering'
72                with actual type `a0 -> Ordering'
73    Expected type: (a0 -> a1) -> a0 -> Ordering
74      Actual type: (a0 -> a1) -> a0 -> a0 -> Ordering
75    In the first argument of `(.)', namely `comparing'
76    In the first argument of `maximumBy', namely `(comparing . length)'
77*Main Data.Function Data.List Data.Ord> let longestZeroSeq parts = fst $ maximum
78By (comparing length) $ filter ((==0) . fst . head) $ groupBy ((==) `on` fst) $
79zip parts [0..]
80
81<interactive>:1:34:
82    Couldn't match expected type `(a0, b0)'
83                with actual type `[(b1, b2)]'
84    In the second argument of `($)', namely
85      `maximumBy (comparing length)
86     $   filter ((== 0) . fst . head)
87       $   groupBy ((==) `on` fst) $ zip parts [0 .. ]'
88    In the expression:
89        fst
90      $   maximumBy (comparing length)
91        $   filter ((== 0) . fst . head)
92          $   groupBy ((==) `on` fst) $ zip parts [0 .. ]
93    In an equation for `longestZeroSeq':
94        longestZeroSeq parts
95          = fst
96          $   maximumBy (comparing length)
97            $   filter ((== 0) . fst . head)
98              $   groupBy ((==) `on` fst) $ zip parts [0 .. ]
99*Main Data.Function Data.List Data.Ord> let longestZeroSeq parts = maximumBy (co
100mparing length) $ filter ((==0) . fst . head) $ groupBy ((==) `on` fst) $ zip pa
101rts [0..]
102*Main Data.Function Data.List Data.Ord> longestZeroSeq [1,0,0,0,0,0,1,0,0,1,0]
103[(0,1),(0,2),(0,3),(0,4),(0,5)]
104*Main Data.Function Data.List Data.Ord> let longestZeroSeq parts = $ maximumBy (
105comparing length) $ filter ((==0) . fst . head) $ groupBy ((==) `on` fst) $ zip
106parts [0..]
107*Main Data.Function Data.List Data.Ord> :r
108[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
109
110IpAddress.hs:32:46: Not in scope: `go'
111
112IpAddress.hs:35:26:
113    Illegal view pattern:  length -> maxZeroLen
114    Use -XViewPatterns to enable view patterns
115
116IpAddress.hs:35:45:
117    Illegal view pattern:  snd . head -> maxZeroAt
118    Use -XViewPatterns to enable view patterns
119
120IpAddress.hs:35:79: Not in scope: `comparing'
121
122IpAddress.hs:35:143: Not in scope: `on'
123Failed, modules loaded: none.
124Prelude Data.Function Data.List Data.Ord> r
125
126<interactive>:1:1: Not in scope: `r'
127Prelude Data.Function Data.List Data.Ord> :r
128[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
129
130IpAddress.hs:35:46: Not in scope: `go'
131
132IpAddress.hs:38:143: Not in scope: `on'
133Failed, modules loaded: none.
134Prelude Data.Function Data.List Data.Ord>
135ghc.exe: panic! (the 'impossible' happened)
136  (GHC version 7.0.3 for i386-unknown-mingw32):
137        thread blocked indefinitely in an MVar operation
138
139Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
140
141
142C:\Users\porges\Desktop\H>ghci IpAddress.hs
143GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
144Loading package ghc-prim ... linking ... done.
145Loading package integer-gmp ... linking ... done.
146Loading package base ... linking ... done.
147Loading package ffi-1.0 ... linking ... done.
148[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
149
150IpAddress.hs:35:46: Not in scope: `go'
151
152IpAddress.hs:38:143: Not in scope: `on'
153Failed, modules loaded: none.
154Prelude> :l test.hs
155[1 of 1] Compiling Main             ( test.hs, interpreted )
156
157test.hs:3:44: Not in scope: `maximumBy'
158
159test.hs:3:55: Not in scope: `comparing'
160
161test.hs:3:105: Not in scope: `groupBy'
162
163test.hs:3:119: Not in scope: `on'
164
165test.hs:3:135: Not in scope: `parts'
166Failed, modules loaded: none.
167Prelude> :r
168[1 of 1] Compiling Main             ( test.hs, interpreted )
169
170test.hs:6:119: Not in scope: `on'
171
172test.hs:6:135: Not in scope: `parts'
173Failed, modules loaded: none.
174Prelude> :r
175[1 of 1] Compiling Main             ( test.hs, interpreted )
176
177test.hs:7:119: Not in scope: `on'
178Failed, modules loaded: none.
179Prelude> :q
180Leaving GHCi.
181
182C:\Users\porges\Desktop\H>ghci IpAddress.hs
183GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
184Loading package ghc-prim ... linking ... done.
185Loading package integer-gmp ... linking ... done.
186Loading package base ... linking ... done.
187Loading package ffi-1.0 ... linking ... done.
188[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
189
190IpAddress.hs:35:46: Not in scope: `go'
191
192IpAddress.hs:38:143: Not in scope: `on'
193Failed, modules loaded: none.
194Prelude> :r
195[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
196
197IpAddress.hs:35:46: Not in scope: `go'
198
199IpAddress.hs:38:143: Not in scope: `on'
200Failed, modules loaded: none.
201Prelude> :r
202[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
203
204IpAddress.hs:34:46: Not in scope: `go'
205
206IpAddress.hs:37:26:
207    Illegal view pattern:  length -> maxZeroLen
208    Use -XViewPatterns to enable view patterns
209
210IpAddress.hs:37:45:
211    Illegal view pattern:  snd . head -> maxZeroAt
212    Use -XViewPatterns to enable view patterns
213
214IpAddress.hs:37:143: Not in scope: `on'
215Failed, modules loaded: none.
216Prelude> :r
217[1 of 1] Compiling Main             ( IpAddress.hs, interpreted )
218
219IpAddress.hs:35:46: Not in scope: `go'
220
221IpAddress.hs:38:143: Not in scope: `on'
222Failed, modules loaded: none.
223Prelude>
224Prelude> let maxZeroSeq parts =
225ghc.exe: panic! (the 'impossible' happened)
226  (GHC version 7.0.3 for i386-unknown-mingw32):
227        thread blocked indefinitely in an MVar operation
228
229Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
230