Skip to content

Commit

Permalink
[ interpolate ] Implement Interpolation for primitive numeric types
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden authored and mattpolzin committed Dec 29, 2023
1 parent 439aa00 commit 3fe95d4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@
* `Ref` interface from `Data.Ref` inherits `Monad` and was extended by a function
for value modification implemented through reading and writing by default.

* Added an `Interpolation` implementation for primitive decimal numeric types and `Nat`.

#### System

* Changes `getNProcessors` to return the number of online processors rather than
Expand Down
15 changes: 15 additions & 0 deletions libs/base/Data/Primitives/Interpolation.idr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Data.Primitives.Interpolation

%default total

export Interpolation Int where interpolate = show
export Interpolation Integer where interpolate = show
export Interpolation Bits8 where interpolate = show
export Interpolation Bits16 where interpolate = show
export Interpolation Bits32 where interpolate = show
export Interpolation Bits64 where interpolate = show
export Interpolation Int8 where interpolate = show
export Interpolation Int16 where interpolate = show
export Interpolation Int32 where interpolate = show
export Interpolation Int64 where interpolate = show
export Interpolation Nat where interpolate = show
1 change: 1 addition & 0 deletions libs/base/base.ipkg
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ modules = Control.App,
Data.Nat,
Data.Nat.Order,
Data.Nat.Views,
Data.Primitives.Interpolation,
Data.Primitives.Views,
Data.Ref,
Data.Rel,
Expand Down

0 comments on commit 3fe95d4

Please sign in to comment.