blob: e4c1ed46977109db5230470ace59296a8740436a (
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
41
42
|
module T6048 where
import Control.Applicative
data X = X
(Maybe String)
(Maybe String)
(Maybe String)
(Maybe String)
(Maybe String)
(Maybe String)
(Maybe String)
(Maybe String)
(Maybe String)
mb :: (String -> Maybe a) -> String -> Maybe (Maybe a)
mb _ "" = Just Nothing
mb _ "-" = Just Nothing
mb p xs = Just <$> p xs
run :: [String] -> Maybe X
run
[ x1
, x2
, x3
, x4
, x5
, x6
, x7
, x8
, x9
] = X
<$> mb pure x1
<*> mb pure x2
<*> mb pure x3
<*> mb pure x4
<*> mb pure x5
<*> mb pure x6
<*> mb pure x7
<*> mb pure x8
<*> mb pure x9
|