Commit c30de057 authored by Andrew Gibiansky's avatar Andrew Gibiansky

allowing two type signatures together

parent 9b95c5e3
......@@ -36,7 +36,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
":ext Impli\n",
":ext NoImplicitPrelude\n",
"4 + 4"
],
"language": "python",
......@@ -45,14 +45,18 @@
},
"outputs": [
{
"html": [
"<span class='err-msg'>Not in scope: `+'<br/>Perhaps you meant `IHaskellPrelude.+' (imported from Prelude)</span>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"8"
"Not in scope: `+'\n",
"Perhaps you meant `IHaskellPrelude.+' (imported from Prelude)"
]
}
],
"prompt_number": 2
"prompt_number": 3
},
{
"cell_type": "code",
......@@ -96,7 +100,9 @@
"parser"
],
"language": "python",
"metadata": {},
"metadata": {
"hidden": false
},
"outputs": [
{
"javascript": [
......
......@@ -218,6 +218,14 @@ joinFunctions (Located line (TypeSignature sig) : Located dl (Declaration decl)
Located line (Declaration $ sig ++ "\n" ++ joinedDecl):remaining
where Located _ (Declaration joinedDecl):remaining = joinFunctions $ Located dl (Declaration decl) : rest
-- Also allow two type signatures. This is necessary for operator
-- declarations in which you have a fixity declaration.
joinFunctions (Located line (TypeSignature sig) :
Located _ (TypeSignature sig') :
Located dl (Declaration decl) : rest) =
Located line (Declaration $ intercalate "\n" [sig, sig', joinedDecl]):remaining
where Located _ (Declaration joinedDecl):remaining = joinFunctions $ Located dl (Declaration decl) : rest
joinFunctions (x:xs) = x : joinFunctions xs
joinFunctions [] = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment