9 "{-# LANGUAGE NegativeLiterals #-}\n",
10 "{-# LANGUAGE FlexibleContexts #-}\n",
11 "{-# LANGUAGE OverloadedStrings #-}"
20 "import Data.Text (Text)\n",
21 "import qualified Data.Text as T\n",
22 "import qualified Data.Text.IO as TIO\n",
24 "import Text.Megaparsec\n",
25 "import qualified Text.Megaparsec.Lexer as L\n",
26 "-- import Text.Megaparsec.Lexer\n",
27 "import Text.Megaparsec.Text (Parser)\n",
29 "import qualified Data.IntMap.Strict as M\n",
30 "import Data.IntMap.Strict ((!))\n",
32 "import qualified Data.Set as S"
41 "type Pipes = M.IntMap (S.Set Int)"
46 "execution_count": 21,
52 "<style>/* Styles used for the Hoogle display in the pager */\n",
55 "padding-bottom: 1.3em;\n",
56 "padding-left: 0.4em;\n",
60 "font-family: monospace;\n",
61 "white-space: pre;\n",
68 "font-weight: bold;\n",
71 "font-weight: bold;\n",
75 "margin-left: 0.4em;\n",
77 ".hoogle-package {\n",
78 "font-weight: bold;\n",
79 "font-style: italic;\n",
82 "font-weight: bold;\n",
85 "font-weight: bold;\n",
89 "font-weight: bold;\n",
90 "font-family: monospace;\n",
92 "white-space: pre-wrap;\n",
96 "font-weight: bold;\n",
97 "font-family: monospace;\n",
98 "margin-left: 1em;\n",
101 "font-family: monospace;\n",
106 "font-style: italic;\n",
107 "font-family: monospace;\n",
108 "white-space: pre;\n",
113 "font-weight: bold;\n",
115 ".err-msg.in.collapse {\n",
116 "padding-top: 0.7em;\n",
118 ".highlight-code {\n",
119 "white-space: pre;\n",
120 "font-family: monospace;\n",
122 ".suggestion-warning { \n",
123 "font-weight: bold;\n",
124 "color: rgb(200, 130, 0);\n",
126 ".suggestion-error { \n",
127 "font-weight: bold;\n",
130 ".suggestion-name {\n",
131 "font-weight: bold;\n",
133 "</style><span class='err-msg'><interactive>:5:5: error:<br/> • Illegal equational constraint Token s ~ Char<br/> (Use GADTs or TypeFamilies to permit this)<br/> • When checking the inferred type<br/> blockCmnt :: forall e s (m :: * -> *). (Token s ~ Char, Text.Megaparsec.Prim.MonadParsec e s m) => m ()<br/> In an equation for ‘sc’:<br/> sc<br/> = L.space space lineCmnt blockCmnt<br/> where<br/> lineCmnt = L.skipLineComment \"//\"<br/> blockCmnt = L.skipBlockComment \"/*\" \"*/\"<br/><interactive>:4:5: error:<br/> • Illegal equational constraint Token s ~ Char<br/> (Use GADTs or TypeFamilies to permit this)<br/> • When checking the inferred type<br/> lineCmnt :: forall e s (m :: * -> *). (Token s ~ Char, Text.Megaparsec.Prim.MonadParsec e s m) => m ()<br/> In an equation for ‘sc’:<br/> sc<br/> = L.space space lineCmnt blockCmnt<br/> where<br/> lineCmnt = L.skipLineComment \"//\"<br/> blockCmnt = L.skipBlockComment \"/*\" \"*/\"</span>"
136 "<interactive>:5:5: error:\n",
137 " • Illegal equational constraint Token s ~ Char\n",
138 " (Use GADTs or TypeFamilies to permit this)\n",
139 " • When checking the inferred type\n",
140 " blockCmnt :: forall e s (m :: * -> *). (Token s ~ Char, Text.Megaparsec.Prim.MonadParsec e s m) => m ()\n",
141 " In an equation for ‘sc’:\n",
143 " = L.space space lineCmnt blockCmnt\n",
145 " lineCmnt = L.skipLineComment \"//\"\n",
146 " blockCmnt = L.skipBlockComment \"/*\" \"*/\"\n",
147 "<interactive>:4:5: error:\n",
148 " • Illegal equational constraint Token s ~ Char\n",
149 " (Use GADTs or TypeFamilies to permit this)\n",
150 " • When checking the inferred type\n",
151 " lineCmnt :: forall e s (m :: * -> *). (Token s ~ Char, Text.Megaparsec.Prim.MonadParsec e s m) => m ()\n",
152 " In an equation for ‘sc’:\n",
154 " = L.space space lineCmnt blockCmnt\n",
156 " lineCmnt = L.skipLineComment \"//\"\n",
157 " blockCmnt = L.skipBlockComment \"/*\" \"*/\""
161 "output_type": "display_data"
166 "sc = L.space space lineCmnt blockCmnt\n",
168 " lineCmnt = L.skipLineComment \"//\"\n",
169 " blockCmnt = L.skipBlockComment \"/*\" \"*/\"\n",
171 "lexeme = L.lexeme sc\n",
172 "integer = lexeme L.integer\n",
174 "symb = L.symbol sc\n",
177 "pipe = assocify <$> integer <*> (symb \"<->\" *> (integer `sepBy` (symb \",\")))\n",
178 " where assocify a b = (a, b)\n"
183 "execution_count": null,
191 "display_name": "Haskell",
192 "language": "haskell",
196 "codemirror_mode": "ihaskell",
197 "file_extension": ".hs",