WordNet 0.1.2 → 1.0.0
raw patch · 5 files changed
+14/−21 lines, 5 filesdep ~basenew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
- NLP.WordNet: instance (Show a) => Show (Queue a)
+ NLP.WordNet: instance Show a => Show (Queue a)
- NLP.WordNet: addListToBag :: (Bag b a) => b a -> [a] -> b a
+ NLP.WordNet: addListToBag :: Bag b a => b a -> [a] -> b a
- NLP.WordNet: addToBag :: (Bag b a) => b a -> a -> b a
+ NLP.WordNet: addToBag :: Bag b a => b a -> a -> b a
- NLP.WordNet: class Bag b a
+ NLP.WordNet: class Bag b a where addListToBag = foldr (flip addToBag)
- NLP.WordNet: emptyBag :: (Bag b a) => b a
+ NLP.WordNet: emptyBag :: Bag b a => b a
- NLP.WordNet: initializeWordNetWithOptions :: Maybe FilePath -> Maybe (String -> Exception -> IO ()) -> IO WordNetEnv
+ NLP.WordNet: initializeWordNetWithOptions :: Maybe FilePath -> Maybe (String -> SomeException -> IO ()) -> IO WordNetEnv
- NLP.WordNet: isEmptyBag :: (Bag b a) => b a -> Bool
+ NLP.WordNet: isEmptyBag :: Bag b a => b a -> Bool
- NLP.WordNet: meet :: (Bag b (Tree SearchResult)) => WN (b (Tree SearchResult) -> SearchResult -> SearchResult -> Maybe SearchResult)
+ NLP.WordNet: meet :: Bag b (Tree SearchResult) => WN (b (Tree SearchResult) -> SearchResult -> SearchResult -> Maybe SearchResult)
- NLP.WordNet: meetPaths :: (Bag b (Tree SearchResult)) => WN (b (Tree SearchResult) -> SearchResult -> SearchResult -> Maybe ([SearchResult], SearchResult, [SearchResult]))
+ NLP.WordNet: meetPaths :: Bag b (Tree SearchResult) => WN (b (Tree SearchResult) -> SearchResult -> SearchResult -> Maybe ([SearchResult], SearchResult, [SearchResult]))
- NLP.WordNet: meetSearchPaths :: (Bag b (Tree SearchResult)) => b (Tree SearchResult) -> Tree SearchResult -> Tree SearchResult -> Maybe ([SearchResult], SearchResult, [SearchResult])
+ NLP.WordNet: meetSearchPaths :: Bag b (Tree SearchResult) => b (Tree SearchResult) -> Tree SearchResult -> Tree SearchResult -> Maybe ([SearchResult], SearchResult, [SearchResult])
- NLP.WordNet: runWordNetWithOptions :: Maybe FilePath -> Maybe (String -> Exception -> IO ()) -> WN a -> IO a
+ NLP.WordNet: runWordNetWithOptions :: Maybe FilePath -> Maybe (String -> SomeException -> IO ()) -> WN a -> IO a
- NLP.WordNet: splitBag :: (Bag b a) => b a -> (a, b a)
+ NLP.WordNet: splitBag :: Bag b a => b a -> (a, b a)
- NLP.WordNet: type WN a = (?wne :: WordNetEnv) => a
+ NLP.WordNet: type WN a = ?wne :: WordNetEnv => a
Files
- NLP/WordNet.hs +3/−3
- NLP/WordNet/PrimTypes.hs +1/−1
- NLP/WordNet/Prims.hs +2/−2
- NLP/WordNet/Util.hs +4/−3
- WordNet.cabal +4/−12
NLP/WordNet.hs view
@@ -64,7 +64,7 @@ import Prelude hiding (catch) import Data.Array import GHC.Arr (unsafeIndex)-import GHC.Handle+import GHC.IO.Handle import Data.Tree import Data.IORef import Data.Dynamic@@ -97,7 +97,7 @@ -- the environment and returns the results in the 'IO' monad. runWordNetWithOptions :: Maybe FilePath -> -- word net data directory- Maybe (String -> Exception -> IO ()) -> -- warning function (by default, warnings go to stderr)+ Maybe (String -> SomeException -> IO ()) -> -- warning function (by default, warnings go to stderr) WN a -> -- what to run IO a runWordNetWithOptions dd warn wn = do@@ -114,7 +114,7 @@ -- | Takes a FilePath to the directory holding WordNet and -- a function to do with warnings, initializes -- the environment and returns a 'WordNetEnv' as in 'initializeWordNet'.-initializeWordNetWithOptions :: Maybe FilePath -> Maybe (String -> Exception -> IO ()) -> IO WordNetEnv+initializeWordNetWithOptions :: Maybe FilePath -> Maybe (String -> SomeException -> IO ()) -> IO WordNetEnv initializeWordNetWithOptions = P.initializeWordNetWithOptions -- | Closes all the handles associated with the 'WordNetEnv'. Since
NLP/WordNet/PrimTypes.hs view
@@ -81,7 +81,7 @@ vSentHandle :: Maybe (Handle, Handle), -- index, real wnReleaseVersion :: Maybe String, dataDirectory :: FilePath,- warnAbout :: String -> Exception -> IO ()+ warnAbout :: String -> SomeException -> IO () } wordNetEnv0 = WordNetEnv {
NLP/WordNet/Prims.hs view
@@ -35,7 +35,7 @@ import Control.Monad (when, liftM, mplus) import Data.List (findIndex, find) import Data.Maybe (isNothing, fromJust, isJust, fromMaybe)-import GHC.Handle -- (openFileEx, BinaryMode(..))+import GHC.IO.Handle -- (openFileEx, BinaryMode(..)) import NLP.WordNet.PrimTypes import NLP.WordNet.Util@@ -55,7 +55,7 @@ -- place on your machine and you don't have the appropriate env vars set up. initializeWordNetWithOptions :: Maybe FilePath -> -- word net data directory- Maybe (String -> Exception -> IO ()) -> -- "warning" function (by default, warnings go to stderr)+ Maybe (String -> SomeException -> IO ()) -> -- "warning" function (by default, warnings go to stderr) IO WordNetEnv initializeWordNetWithOptions mSearchdir mWarn = do searchdir <- case mSearchdir of { Nothing -> getDefaultSearchDir ; Just d -> return d }
NLP/WordNet/Util.hs view
@@ -7,7 +7,8 @@ import Data.Char (toLower) import Data.List (nub) import Data.Maybe (fromMaybe)-import GHC.Handle+import GHC.IO.Handle+import System.IO data IOModeEx = BinaryMode IOMode | AsciiMode IOMode deriving (Eq, Ord, Show, Read) @@ -47,9 +48,9 @@ charForPOS (Adv) = "r" tryMaybe :: IO a -> IO (Maybe a)-tryMaybe a = (a >>= return . Just) `catch` (const (return Nothing))+tryMaybe a = (a >>= return . Just) `catch` (\(_ :: SomeException) -> return Nothing) -tryMaybeWarn :: (Exception -> IO ()) -> IO a -> IO (Maybe a)+tryMaybeWarn :: Exception e => (e -> IO ()) -> IO a -> IO (Maybe a) tryMaybeWarn warn a = (a >>= return . Just) `catch` (\e -> warn e >> return Nothing) partName :: POS -> String
WordNet.cabal view
@@ -1,5 +1,5 @@ Name: WordNet-Version: 0.1.2+Version: 1.0.0 Description: A pure-Haskell interface to the WordNet lexical database of English. Depends on the WordNet database, but not on the WordNet source code.@@ -11,16 +11,10 @@ Maintainer: Max Rabkin <max.rabkin@gmail.com> Build-Depends: base, filepath Build-Type: Simple-Cabal-Version: >= 1.2--Flag small_base- Description: Choose the new smaller, split-up base package.+Cabal-Version: >= 1.8 Library- if flag(small_base)- Build-Depends: base >= 3, containers, filepath, array- else- Build-Depends: base < 3, filepath+ Build-depends: base == 4.*, containers, filepath, array Exposed-Modules: NLP.WordNet@@ -33,6 +27,4 @@ NLP.WordNet.Prims NLP.WordNet.Types - GHC-Options: -fglasgow-exts-- Extensions: CPP+ Extensions: CPP, DeriveDataTypeable, ImplicitParams, MultiParamTypeClasses, RankNTypes, ScopedTypeVariables