Skip to content

Automatically generate useful functions for common operations for Elm custom types

Notifications You must be signed in to change notification settings

edkelly303/elm-any-type-operations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Any-type operations

What?

Order allows you to define comparison functions quickly for your custom types. Look at the Order module first to see how this works.

Enum builds on Order with some additional useful functions for custom types that have a finite number of variants.

Arithmetic lets you define arithmetic operations for your custom types. (I'm less convinced that this one is actually useful).

Why?

Sometimes you define a custom type, and you really want it to be comparable so that you can use comparison operators like < or >=. But it isn't. So you can't.

Or you want to perform some kind of mathematical calculations with your types using arithmetic operators like + or *. But they aren't numbers. So you can't.

This package provides a cheap way to define a bunch of functions that allow you to treat custom types almost like comparable or number types.

Are these like... typeclasses?

I don't think so ¯\_(ツ)_/¯

Hopefully, they are still useful though.

About

Automatically generate useful functions for common operations for Elm custom types

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages