Haskell modules in TypeScript
TypeScript implementations of 10 Haskell standard library functions across 1 module. Each function is individually importable and tree-shakeable.
listWe have 10 Haskell functions so far - help us add more
Got a rainy Sunday afternoon and a taste for a porting puzzle?
- Get inspiration from the Haskell base Data.List docs.
- Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.
We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.
Upstream Surface Inventory 10/3210 shipped · 213 next 0%
Locutus tracks 131 upstream namespaces for Haskell and sorts them into what is already shipped, what we still want, what we intentionally keep, and what still needs a decision.
This inventory now tracks a broader official `base` module slice for Haskell's core plain-value helpers, not the wider Hackage ecosystem.
In progress
Shipped (10)
Next
Pure list transforms and combinatorics helpers are strong plain-value portability targets.
allandanybreakconcatconcatMapcycledeletedeleteBydeleteFirstsBydropdropWhiledropWhileEndelemelemIndexelemIndicesfilterfindfindIndexfindIndicesFoldablefoldlfoldl'foldrgenericDropgenericIndexgenericLengthgenericReplicategenericSplitAtgenericTakeinitinsertinsertByintersectintersectByisInfixOfisPrefixOfisSubsequenceOfisSuffixOfiterateiterate'lengthlinesListlookupmapmapAccumLmapAccumRnotElemnubnullorpartitionproductrepeatreplicatereversescanlscanl'scanl1scanrscanr1singletonsortsortBysortOnspansplitAtstripPrefixsumtailtaketakeWhileTraversableunconsunfoldrunionunionByunlinesunsnocunwordsunzip3unzip4unzip5unzip6unzip7wordszipzip3zip4zip5zip6zip7zipWithzipWith3zipWith4zipWith5zipWith6zipWith7
Numeric
Next
Base-conversion and numeric-format helpers are strong portability targets.
acosacoshasinasinhatanatanhcoscoshexpexpm1floatToDigitsfromRatlexDigitsloglog1mexplog1plog1pexplogBasepireadBinreadDecreadFloatreadHexreadIntreadOctreadSignedshowBinshowEFloatshowFFloatshowFFloatAltshowFloatshowGFloatshowGFloatAltshowHexshowHFloatshowIntshowIntAtBaseshowOctshowSignedsinsinhsqrttantanh
Explicit non-goals (2)
-
classTypeclass and declaration exports are runtime/model declarations rather than direct plain-value helpers. -
FloatingTypeclass and declaration exports are runtime/model declarations rather than direct plain-value helpers.
Data.Char
Next
Character classification and case helpers are strong Haskell plain-value portability targets.
chrdigitToIntgeneralCategoryintToDigitisAlphaisAlphaNumisAsciiisAsciiLowerisAsciiUpperisControlisDigitisHexDigitisLatin1isLetterisLowerisLowerCaseisMarkisNumberisOctDigitisPrintisPunctuationisSeparatorisSpaceisSymbolisUpperisUpperCaselexLitCharordreadLitCharshowLitChartoLowertoTitletoUpper
Explicit non-goals (32)
-
CharType and category exports are runtime/model declarations rather than direct plain-value helpers. -
ClosePunctuationType and category exports are runtime/model declarations rather than direct plain-value helpers. -
ConnectorPunctuationType and category exports are runtime/model declarations rather than direct plain-value helpers. -
ControlType and category exports are runtime/model declarations rather than direct plain-value helpers. -
CurrencySymbolType and category exports are runtime/model declarations rather than direct plain-value helpers. -
DashPunctuationType and category exports are runtime/model declarations rather than direct plain-value helpers. -
DecimalNumberType and category exports are runtime/model declarations rather than direct plain-value helpers. -
EnclosingMarkType and category exports are runtime/model declarations rather than direct plain-value helpers. -
FinalQuoteType and category exports are runtime/model declarations rather than direct plain-value helpers. -
FormatType and category exports are runtime/model declarations rather than direct plain-value helpers. -
GeneralCategoryType and category exports are runtime/model declarations rather than direct plain-value helpers. -
InitialQuoteType and category exports are runtime/model declarations rather than direct plain-value helpers. -
LetterNumberType and category exports are runtime/model declarations rather than direct plain-value helpers. -
LineSeparatorType and category exports are runtime/model declarations rather than direct plain-value helpers. -
LowercaseLetterType and category exports are runtime/model declarations rather than direct plain-value helpers. -
MathSymbolType and category exports are runtime/model declarations rather than direct plain-value helpers. -
ModifierLetterType and category exports are runtime/model declarations rather than direct plain-value helpers. -
ModifierSymbolType and category exports are runtime/model declarations rather than direct plain-value helpers. -
NonSpacingMarkType and category exports are runtime/model declarations rather than direct plain-value helpers. -
NotAssignedType and category exports are runtime/model declarations rather than direct plain-value helpers. -
OpenPunctuationType and category exports are runtime/model declarations rather than direct plain-value helpers. -
OtherLetterType and category exports are runtime/model declarations rather than direct plain-value helpers. -
OtherNumberType and category exports are runtime/model declarations rather than direct plain-value helpers. -
OtherPunctuationType and category exports are runtime/model declarations rather than direct plain-value helpers. -
OtherSymbolType and category exports are runtime/model declarations rather than direct plain-value helpers. -
ParagraphSeparatorType and category exports are runtime/model declarations rather than direct plain-value helpers. -
PrivateUseType and category exports are runtime/model declarations rather than direct plain-value helpers. -
SpaceType and category exports are runtime/model declarations rather than direct plain-value helpers. -
SpacingCombiningMarkType and category exports are runtime/model declarations rather than direct plain-value helpers. -
SurrogateType and category exports are runtime/model declarations rather than direct plain-value helpers. -
TitlecaseLetterType and category exports are runtime/model declarations rather than direct plain-value helpers. -
UppercaseLetterType and category exports are runtime/model declarations rather than direct plain-value helpers.
Data.Ord
Next
Ordering helpers over plain values are strong Haskell portability targets.
clampclasscomparecomparingDownEQgetDownGTLTmaxminnewtypeOrdOrdering
Data.Tuple
Next
Tuple projection and transformation helpers map cleanly to plain arrays.
curryfstgetSoloMkSolopatternsndSoloswapuncurry
Data.Maybe
Next
Null-filtering helpers have a clean plain-value contract.
catMaybes
Defaulting helpers have a clean plain-value contract.
fromMaybe
Optional-value predicates have a clean plain-value contract.
isJustisNothing
Combined map-filter helpers are strong plain-value targets.
mapMaybe
Optional branching over plain values has a clean contract.
maybe
Explicit non-goals (6)
-
fromJustMaybe wrappers do not map directly to one stable plain-value contract. -
JustMaybe wrappers do not map directly to one stable plain-value contract. -
listToMaybeMaybe wrappers do not map directly to one stable plain-value contract. -
MaybeMaybe wrappers do not map directly to one stable plain-value contract. -
maybeToListMaybe wrappers do not map directly to one stable plain-value contract. -
NothingMaybe wrappers do not map directly to one stable plain-value contract.
Data.Bool
Next
Boolean branching helpers have a clean plain-value contract.
boolnototherwise
Explicit non-goals (3)
-
BoolType and constructor exports are runtime/model declarations rather than direct plain-value helpers. -
FalseType and constructor exports are runtime/model declarations rather than direct plain-value helpers. -
TrueType and constructor exports are runtime/model declarations rather than direct plain-value helpers.
Data.Either
Next
Branching over plain values still has a useful portability contract.
either
Sum-type predicates have a clean plain-value contract.
isLeftisRight
Explicit non-goals (8)
-
EitherSum-type wrappers do not map directly to one stable plain-value contract. -
fromLeftSum-type wrappers do not map directly to one stable plain-value contract. -
fromRightSum-type wrappers do not map directly to one stable plain-value contract. -
LeftSum-type wrappers do not map directly to one stable plain-value contract. -
leftsSum-type wrappers do not map directly to one stable plain-value contract. -
partitionEithersSum-type wrappers do not map directly to one stable plain-value contract. -
RightSum-type wrappers do not map directly to one stable plain-value contract. -
rightsSum-type wrappers do not map directly to one stable plain-value contract.
Data.Function
Next
Comparator and projection composition still has a useful plain-value portability contract.
on
Explicit non-goals (4)
-
applyWhenHigher-order function combinators are less compelling than direct JS equivalents by default. -
constHigher-order function combinators are less compelling than direct JS equivalents by default. -
fixHigher-order function combinators are less compelling than direct JS equivalents by default. -
flipHigher-order function combinators are less compelling than direct JS equivalents by default.
Numeric.Natural
Next
Numeric helper modules are strong scalar and formatting portability targets.
minusNaturalMaybe
Explicit non-goals (1)
-
NaturalType exports are runtime/model declarations rather than direct plain-value helpers.