Changeset 6682 for src/Pugs/Internals.hs

Show
Ignore:
Timestamp:
09/04/05 09:32:39 (3 years ago)
Author:
luqui
Message:

Created a warning that warns when you try to export an operator. The problem
came up with Set that exported &infix:<->, thus *overriding* the default
numeric minus, and causing wacky infinite loops all over the place!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Internals.hs

    r5963 r6682  
    7272    maybeM, 
    7373    safeMode, 
     74    warn, 
     75    die, 
    7476) where 
    7577 
     
    147149    "Internal error:\n    " ++ s ++ "\nPlease file a bug report." 
    148150 
     151die :: (MonadIO m, Show a) => String -> a -> m b 
     152die x y = do 
     153    warn x y 
     154    liftIO $ exitFailure 
     155 
     156warn :: (MonadIO m, Show a) => String -> a -> m () 
     157warn str val = liftIO $ do 
     158    hPutStrLn stderr $ "*** " ++ str ++ ":\n    " ++ show val 
     159 
    149160split :: (Eq a) => [a] -> [a] -> [[a]] 
    150161split []  _   = internalError "splitting by an empty list"