mixed-types-num

Alternative Prelude with numeric and logic expressions typed bottom-up

https://github.com/michalkonecny/mixed-types-num

Version on this page:0.2.0.1
LTS Haskell 22.17:0.5.12
Stackage Nightly 2024-04-18:0.5.12
Latest on Hackage:0.5.12

See all snapshots mixed-types-num appears in

BSD-3-Clause licensed by Michal Konecny
Maintained by Michal Konecny
This version can be pinned in stack with:mixed-types-num-0.2.0.1@sha256:52e3631cd736cc269e8d2d3c4caac25431784ba38eecf03089591516418b93e2,2900

Module documentation for 0.2.0.1

  • Control
    • Control.CollectErrors
  • MixedTypesNumPrelude
  • Numeric
    • Numeric.CollectErrors
    • Numeric.MixedTypes
      • Numeric.MixedTypes.AddSub
      • Numeric.MixedTypes.Bool
      • Numeric.MixedTypes.Complex
      • Numeric.MixedTypes.Elementary
      • Numeric.MixedTypes.Eq
      • Numeric.MixedTypes.Field
      • Numeric.MixedTypes.Literals
      • Numeric.MixedTypes.MinMaxAbs
      • Numeric.MixedTypes.Ord
      • Numeric.MixedTypes.PreludeHiding
      • Numeric.MixedTypes.Ring
      • Numeric.MixedTypes.Round
  • Utils
    • Utils.TH
      • Utils.TH.DeclForTypes

This package provides a version of Prelude where unary and binary operations such as not, +, == have their result type derived from the parameter type(s) and thus supports mixed-type arithmetic and comparisons.

See module MixedTypesNumPrelude for further documentation.

Ghci 8.0.* fails when loading this package due to ghc bug 13385. This bug does not affect ghci 7.10.3 and ghci 8.2.1.

Changes

  • v 0.1

    • first release
  • v 0.2

    • new CollectErrors wrapper
    • CN, specialisation of CollectErrors to NumErrors
    • numerical partial operators (eg division) return a CN type
    • instances for Data.Complex
  • v 0.2.0.1

    • fix compilation bug in test suite
    • minor doc improvements
    • fix Complex instances of error-throwing division (/!)