Git Product home page Git Product logo

hamsters's Introduction

Hamsters

A mini Scala utility library. Compatible with functional programming beginners. For the JVM and Scala.js.

hamster logo

Currently, Hamsters supports :

  • Validation
  • Monad transformers
  • Future squash operations
  • Enum typeclass
  • Default values for options (orEmpty)
  • HLists
  • Union types
  • NonEmptyList
  • Show
  • mapN
  • Lenses
  • Memoization
  • Retry
  • Clazz

Documentation

2.6.0 documentation

Master documentation

Travis

Install as dependency

With SBT :

libraryDependencies ++= Seq(
  "io.github.scala-hamsters" %% "hamsters" % "2.6.0"
)

With Maven :

<dependency>
  <groupId>io.github.scala-hamsters</groupId>
  <artifactId>hamsters_${scala.version}</artifactId>
  <version>2.6.0</version>
</dependency>

For Scala.js :

libraryDependencies ++= Seq(
  "io.github.scala-hamsters" %%% "hamsters" % "2.6.0"
)

Try Hamsters in ScalaFiddle or Ammonite

You can try Hamsters quickly and easily with ScalaFiddle.
Example : https://scalafiddle.io/sf/BDm8W4U/0

Alternatively, a REPL script is provided. try-hamster.sh script downloads and installs Coursier, Ammonite REPL and Hamsters dependency. No dependencies needed other than a JDK.

PS: The macros don't work with the REPL

curl -s https://raw.githubusercontent.com/scala-hamsters/hamsters/master/scripts/try-hamsters.sh | bash

Loading...
Welcome to the Ammonite Repl 1.0.1
(Scala 2.12.3 Java 1.8.0_151)

@ val noneString: Option[String] = None 
noneString: Option[String] = None

@ noneString.orEmpty 
res1: String = ""

@ val hlist1: Double :: String :: HNil = 2.0 :: "hi" :: HNil 
hlist1: Double :: String :: HNil = HCons(2.0, HCons("hi", HNIL))

@ exit 
Bye!

1.x to 2.0 Migration

Validation.result has been renamed to Validation.run.

Extensions

See hamsters-extensions for more information.

Scaladoc

You can find the API documentation here.

Special thanks

To Laurencebeillaux who created the Hamsters logo.

hamsters's People

Contributors

loicdescotte avatar dgouyette avatar oraclewalid avatar raulraja avatar remk avatar k33g avatar andys8 avatar ludoviclafole avatar urcadox avatar francisdb avatar thomasgrt avatar

Watchers

Guillaume Grossetie avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.