on master help sign in
Merge pull request #2 from michaelt/master

Fix ambiguity with Prelude.foldl

commit12976d33f0df9c61ce78b5eea973c81add0e3c68 authorEvan Czaplicki <info@elm-lang.org> dateFri 27 Apr 2012, 10:07 (15 years ago) parent1290b91e39af23
1 file changed+3−3
src/Parse/Binop.hs+3−3
src/Parse/Binop.hs+3−3
@@ -5,7 +5,7 @@ import Combinators
55import Control.Monad (liftM,guard)
66import Control.Monad.Error
77import Data.List (foldl',splitAt,elemIndices,group,groupBy,sortBy,find)
8−import Data.Map as Map
8+import qualified Data.Map as Map
99import Data.Maybe (mapMaybe)
1010
1111data Assoc = L | Non | R deriving (Eq,Show)
@@ -45,14 +45,14 @@ binopOf seen (tbl@((lvl, L, op):rest)) ops es =
4545 case elemIndices op ops of
4646 [] -> binopOf seen rest ops es
4747 is -> case Map.lookup lvl seen of
48− Nothing -> binopSplit (insert lvl (L,op) seen) tbl (last is) ops es
48+ Nothing -> binopSplit (Map.insert lvl (L,op) seen) tbl (last is) ops es
4949 Just (L,_) -> binopSplit seen tbl (last is) ops es
5050 Just (assoc,op') -> Left $ errorMessage lvl op L op' assoc
5151binopOf seen (tbl@((lvl, assoc, op):rest)) ops es =
5252 case elemIndices op ops of
5353 [] -> binopOf seen rest ops es
5454 i:_ -> case Map.lookup lvl seen of
55− Nothing -> binopSplit (insert lvl (R,op) seen) tbl i ops es
55+ Nothing -> binopSplit (Map.insert lvl (R,op) seen) tbl i ops es
5656 Just (assoc',op') ->
5757 if assoc == assoc' && assoc /= Non then
5858 binopSplit seen tbl i ops es