packages feed

ghc-bignum-orphans (empty) → 0.1

raw patch · 4 files changed

+77/−0 lines, 4 filesdep +basedep +ghc-bignum

Dependencies added: base, ghc-bignum

Files

+ CHANGELOG.md view
@@ -0,0 +1,2 @@+## 0.1 [2021.08.29]+* Backport the `Eq` and `Ord` instances for `BigNat`.
+ README.md view
@@ -0,0 +1,20 @@+# `ghc-bignum-orphans`+[![Hackage](https://img.shields.io/hackage/v/ghc-bignum-orphans.svg)][Hackage: ghc-bignum-orphans]+[![Hackage Dependencies](https://img.shields.io/hackage-deps/v/ghc-bignum-orphans.svg)](http://packdeps.haskellers.com/reverse/ghc-bignum-orphans)+[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)][Haskell.org]+[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)][tl;dr Legal: BSD3]+[![Build Status](https://github.com/haskell-compat/ghc-bignum-orphans/workflows/Haskell-CI/badge.svg)](https://github.com/haskell-compat/ghc-bignum-orphans/actions?query=workflow%3AHaskell-CI)++[Hackage: ghc-bignum-orphans]:+  http://hackage.haskell.org/package/ghc-bignum-orphans+  "ghc-bignum-orphans package on Hackage"+[Haskell.org]:+  http://www.haskell.org+  "The Haskell Programming Language"+[tl;dr Legal: BSD3]:+  https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29+  "BSD 3-Clause License (Revised)"++`ghc-bignum-orphans` defines orphan instances that mimic instances available in+later versions of `ghc-bignum` to a wider (older) range of compilers.+`ghc-bignum-orphans` does not export anything except the orphan instances themselves.
+ ghc-bignum-orphans.cabal view
@@ -0,0 +1,30 @@+cabal-version:      2.4+name:               ghc-bignum-orphans+version:            0.1+synopsis:           Backwards-compatible orphan instances for ghc-bignum+description:        @ghc-bignum-orphans@ defines orphan instances that mimic+                    instances available in later versions of @ghc-bignum@ to a+                    wider (older) range of compilers. @ghc-bignum-orphans@ does+                    not export anything except the orphan instances themselves.+homepage:           https://github.com/haskell-compat/ghc-bignum-orphans+bug-reports:        https://github.com/haskell-compat/ghc-bignum-orphans/issues+license:            BSD-3-Clause+author:             Ryan Scott+maintainer:         Ryan Scott <ryan.gl.scott@gmail.com>+copyright:          (C) 2021 Ryan Scott+category:           Compatibility+extra-source-files: CHANGELOG.md, README.md+tested-with:        GHC == 9.0.1+                     || == 9.2.*++source-repository head+  type:               git+  location:           https://github.com/haskell-compat/ghc-bignum-orphans++library+    exposed-modules:  GHC.Num.Orphans+    build-depends:    base       >= 4.15 && < 5+                    , ghc-bignum >= 1.0  && < 1.3+    hs-source-dirs:   src+    default-language: Haskell2010+    ghc-options:      -Wall -Wcompat
+ src/GHC/Num/Orphans.hs view
@@ -0,0 +1,25 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE MagicHash #-}+{-# OPTIONS_GHC -Wno-orphans #-}+{-|+Exports orphan instances that mimic instances available in later versions of+@ghc-bignum@. To use them, simply @import GHC.Num.Orphans ()@.+-}+module GHC.Num.Orphans () where++#if !(MIN_VERSION_ghc_bignum(1,1,0))+import GHC.Num.BigNat+#endif++#if !(MIN_VERSION_ghc_bignum(1,1,0))+instance Eq BigNat where+   BN# a == BN# b = bigNatEq a b+   BN# a /= BN# b = bigNatNe a b++instance Ord BigNat where+   (BN# a) `compare` (BN# b) = bigNatCompare a b+   BN# a <  BN# b = bigNatLt a b+   BN# a <= BN# b = bigNatLe a b+   BN# a >  BN# b = bigNatGt a b+   BN# a >= BN# b = bigNatGe a b+#endif