llvm-general 3.3.8.0 → 3.3.8.1
raw patch · 2 files changed
+27/−17 lines, 2 filesdep ~llvm-generaldep ~llvm-general-puresetup-changed
Dependency ranges changed: llvm-general, llvm-general-pure
Files
- Setup.hs +21/−11
- llvm-general.cabal +6/−6
Setup.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleInstances #-} import Control.Exception (SomeException, try) import Control.Monad import Data.Maybe@@ -28,18 +29,27 @@ "llvm-config" ] +findJustBy :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b)+findJustBy f (x:xs) = do+ x' <- f x+ case x' of+ Nothing -> findJustBy f xs+ j -> return j+findJustBy _ [] = return Nothing++class ProgramSearch a where+ programSearch :: (String -> a) -> a++-- this instance is used before Cabal-1.18.0, when programFindLocation took one argument+instance Monad m => ProgramSearch (v -> m (Maybe b)) where+ programSearch checkName = \v -> findJustBy (\n -> checkName n v) llvmConfigNames++-- this instance is used for and after Cabal-1.18.0, when programFindLocation took two arguments+instance Monad m => ProgramSearch (v -> p -> m (Maybe b)) where+ programSearch checkName = \v p -> findJustBy (\n -> checkName n v p) llvmConfigNames+ llvmProgram = (simpleProgram "llvm-config") {- programFindLocation = - let- findJustBy :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b)- findJustBy f (x:xs) = do- x' <- f x- case x' of- Nothing -> findJustBy f xs- j -> return j- findJustBy _ [] = return Nothing- in - \v -> findJustBy (findProgramLocation v) llvmConfigNames,+ programFindLocation = programSearch (programFindLocation . simpleProgram), programFindVersion = let stripSuffix suf str = let r = reverse in liftM r (stripPrefix (r suf) (r str))
llvm-general.cabal view
@@ -1,5 +1,5 @@ name: llvm-general-version: 3.3.8.0+version: 3.3.8.1 license: BSD3 license-file: LICENSE author: Benjamin S.Scarlet <fgthb0@greynode.net>@@ -16,7 +16,7 @@ handles almost all of the stateful complexities of using the LLVM API to build IR; and it supports moving IR not only from Haskell into LLVM C++ objects, but the other direction - from LLVM C++ into Haskell. .- For haddock, see <http://bscarlet.github.io/llvm-general/3.3.8.0/doc/html/llvm-general/index.html>.+ For haddock, see <http://bscarlet.github.io/llvm-general/3.3.8.1/doc/html/llvm-general/index.html>. extra-source-files: src/LLVM/General/Internal/FFI/Analysis.h src/LLVM/General/Internal/FFI/Constant.h@@ -38,7 +38,7 @@ type: git location: git://github.com/bscarlet/llvm-general.git branch: llvm-3.3- tag: v3.3.8.0+ tag: v3.3.8.1 flag shared-llvm description: link against llvm shared rather than static library@@ -62,7 +62,7 @@ parsec >= 3.1.3, array >= 0.4.0.0, setenv >= 0.1.0,- llvm-general-pure == 3.3.8.0+ llvm-general-pure == 3.3.8.1 extra-libraries: stdc++ hs-source-dirs: src extensions:@@ -188,8 +188,8 @@ HUnit >= 1.2.4.2, test-framework-quickcheck2 >= 0.3.0.1, QuickCheck >= 2.5.1.1,- llvm-general == 3.3.8.0,- llvm-general-pure == 3.3.8.0,+ llvm-general == 3.3.8.1,+ llvm-general-pure == 3.3.8.1, containers >= 0.4.2.1, mtl >= 2.0.1.0 hs-source-dirs: test