Hello community, here is the log from the commit of package alex for openSUSE:Factory checked in at 2015-08-25 07:19:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alex (Old) and /work/SRC/openSUSE:Factory/.alex.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alex" Changes: -------- --- /work/SRC/openSUSE:Factory/alex/alex.changes 2015-05-21 08:10:53.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.alex.new/alex.changes 2015-08-25 08:45:44.000000000 +0200 @@ -1,0 +2,6 @@ +Wed May 13 09:19:35 UTC 2015 - [email protected] + +- add alex-3.1.4-ghc-7.10.patch +* temporary disable tests + +------------------------------------------------------------------- Old: ---- _service New: ---- alex-3.1.4-ghc-7.10.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alex.spec ++++++ --- /var/tmp/diff_new_pack.hm5LwL/_old 2015-08-25 08:45:45.000000000 +0200 +++ /var/tmp/diff_new_pack.hm5LwL/_new 2015-08-25 08:45:45.000000000 +0200 @@ -29,6 +29,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://hackage.haskell.org/package/%{name} Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM alex-3.1.4-ghc-7.10.patch -- fix for new prelude in ghc-7.10 -- Sergei Trofimovich +Patch0: alex-3.1.4-ghc-7.10.patch + BuildRequires: autoconf BuildRequires: ghc-Cabal-devel BuildRequires: ghc-QuickCheck-devel @@ -36,9 +39,6 @@ BuildRequires: ghc-containers-devel BuildRequires: ghc-directory-devel BuildRequires: ghc-rpm-macros -%if %{with tests} -BuildRequires: ghc-process-devel -%endif %description Alex is a tool for generating lexical analysers in Haskell. It takes a @@ -48,6 +48,7 @@ %prep %setup -q +%patch0 -p1 %build %ghc_bin_build @@ -60,11 +61,6 @@ mkdir -p %{buildroot}/%{_mandir}/man1 cp doc/alex.1 %{buildroot}/%{_mandir}/man1 -%check -%if %{with tests} -%cabal test -%endif - %files %defattr(-,root,root,-) %doc LICENSE ANNOUNCE README TODO ++++++ alex-3.1.4-ghc-7.10.patch ++++++ diff --git a/templates/wrappers.hs b/templates/wrappers.hs index a1a1a6d..c020cc7 100644 --- a/templates/wrappers.hs +++ b/templates/wrappers.hs @@ -284,6 +284,19 @@ runAlex input (Alex f) newtype Alex a = Alex { unAlex :: AlexState -> Either String (AlexState, a) } +instance Functor Alex where + fmap f a = Alex $ \s -> case unAlex a s of + Left msg -> Left msg + Right (s', a') -> Right (s', f a') + +instance Applicative Alex where + pure a = Alex $ \s -> Right (s, a) + fa <*> a = Alex $ \s -> case unAlex fa s of + Left msg -> Left msg + Right (s', f) -> case unAlex a s' of + Left msg -> Left msg + Right (s'', b) -> Right (s'', f b) + instance Monad Alex where m >>= k = Alex $ \s -> case unAlex m s of Left msg -> Left msg
