Haskell.Prelude NuGet Package

The well-tested analogy for part of very usefull Haskell's basic functions library created in C#.

Implemented:
Abs
Map
Foldr
Foldr1
Foldl
Foldl1
Head
Tail
All
And
Or
Chr
Ord
Break
Span
Concat
ConcatMap
Const
Not
DigitToInt
Drop
Even
DropWhile
Elem
Any
Filter
Flip
Fst
Snd
GCD
ID
Init
Iterate
Last
LCM
Length
Lines
Max
Min
Maximum
Minimum
NotElem
Null
Odd
Repeat
Replicate
Take
Reverse
Show
Sort
SplitAt
TakeWhile
ToUpper
IsUpper
ToLower
IsLower
Unlines
Until
Unwords
Words
Zip
ZipWith
Atan
Compare
Cos
Div
Error
Exp
Floor
FromIntegral
IsAlpha
IsDigit
IsSpace
Log
Mod
Product
Rem
Quot
Sin
Sum
Truncate

Implemented like:
Extensions - the most significant param is extended and, of course, the first one (usually the enumerator of something)

Changes:
Error does not return a type
Compare returns same value as CompareTo (-1, 0, 1) instead Eq enum (LT, EQ, GT)
FromIntegral just casting int to double
Print and PutStr have additional parameter StringBuilder which return after write

Implementation details:
The mathematical functions like sin, cos, .

are easyilly implemented using System.Math and was not tested
The class use nothing more then System library and Ienumerable interface
The numerict functions are supported only for int and double (Sum, Product)

Not implemented:
pred
succ
undefined
operators - it is not posible define or redefine properly (you have to use standard C# operators)

Use only these functions can be useful for production code or like exercise for work with functions and composition of functions,
but a lot of from prelude has been already implemented in System.Linq.




Got any Haskell.Prelude Question?





Info

Version: 1.0.0
Author(s): Hozna Kužel
Last Update: Friday, November 15, 2019
.NET Fiddle: Create the first Fiddle
Project Url: http://www.cse.chalmers.se/edu/course/TDA555/tourofprelude.html
NuGet Url: https://www.nuget.org/packages/Haskell.Prelude


Install
Install-Package Haskell.Prelude
dotnet add package Haskell.Prelude
paket add Haskell.Prelude
Haskell.Prelude Download (Unzip the "nupkg" after downloading)





STATS

must-have-score

avg-downloads-per-day

0

days-since-last-release

2031