benmos / pathtype

Typesafe Haskell filepaths. (Plain Haskell 2010 - uses vanilla HM phantom types)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove NonNegative from System.Path.Internal

henrylaxen opened this issue · comments

Dear Ben,

I tried to compile your pathtype module yesterday, and discovered that the latest (2.7.6) version of quickcheck no longer defines a Num or Integral instance of NonNegative:

newtype NonNegative a = NonNegative {getNonNegative :: a}
 deriving ( Eq, Ord, Show, Read
#ifndef NO_NEWTYPE_DERIVING
          , Enum
#endif
          )

Which causes your System.Path.Internal module to not compile. I removed the NonNegative patterns from System.Path.Internal and it seems to work okay. Here is the diff:

855c855
<   (NonNegative numDirs) <- arbitrarySizedIntegral

---
>   numDirs <- arbitrarySizedIntegral
863c863
<   (NonNegative numDirs) <- arbitrarySizedIntegral

---
>   numDirs <- arbitrarySizedIntegral

I hope this is helpful.
Best wishes,
Henry Laxen

Thanks Henry!

I'll apply the patch as soon as I get a chance.

Ben Moseley - Programmer
ben@benmoseley.net
www.benmoseley.net
M: +44 7788 138855

On 28 Jul 2014, at 17:26, Henry Laxen notifications@github.com wrote:

Dear Ben,

I tried to compile your pathtype module yesterday, and discovered that the latest (2.7.6) version of quickcheck no longer defines a Num or Integral instance of NonNegative:

newtype NonNegative a = NonNegative {getNonNegative :: a}
deriving ( Eq, Ord, Show, Read
#ifndef NO_NEWTYPE_DERIVING
, Enum
#endif
)
Which causes your System.Path.Internal module to not compile. I removed the NonNegative patterns from System.Path.Internal and it seems to work okay. Here is the diff:

855c855

< (NonNegative numDirs) <- arbitrarySizedIntegral

numDirs <- arbitrarySizedIntegral
863c863

< (NonNegative numDirs) <- arbitrarySizedIntegral

numDirs <- arbitrarySizedIntegral
I hope this is helpful.
Best wishes,
Henry Laxen


Reply to this email directly or view it on GitHub.

I've put a new version candidate (that supports QuickCheck 2.7.6) out here: https://hackage.haskell.org/package/pathtype-0.5.4/candidate

Let me know if that works for you.