Scala IO monad
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bench/src/test/scala
concurrent/src/main/scala/sio/concurrent
core/src/main/scala/sio
eff/src/main/scala/sio/eff
example/src/main/scala
iteratee-files/src/main/scala/sio/iteratee/files
iteratee-gzip/src/main/scala/sio/iteratee/gzip
iteratee/src/main/scala/sio/iteratee
project
regions/src/main/scala/sio/regions
teletype/src/main/scala/sio/teletype
.gitignore
LICENSE
README.md
build.sbt

README.md

sio

Scala IO monad

import sio.core.{ IO, SafeApp }
import sio.teletype._

object App extends SafeApp {
  val getUserHome: IO[String] = IO { Option(System.getProperty("user.home")).get }

  def run(args: List[String]): IO[Unit] = for {
    h <- getUserHome
    _ <- putStr("What's your name? ")
    n <- getLine
    _ <- putStrLn(s"Hi, $n, your home directory is $h!")
  } yield ()
}

See more examples here.

Quick Start

resolvers += Resolver.bintrayRepo("alexknvl", "maven")

libraryDependencies ++= ((version: String) => List(
  // Core data types, including ST and IO
  "com.alexknvl"  %%  "sio-core"           % version,
  "com.alexknvl"  %%  "sio-concurrent"     % version,
  // Iteratees
  "com.alexknvl"  %%  "sio-iteratee"       % version,
  "com.alexknvl"  %%  "sio-iteratee-files" % version,
  "com.alexknvl"  %%  "sio-iteratee-gzip"  % version,
  // Monadic Regions  
  "com.alexknvl"  %%  "sio-regions"        % version,
  // Eff monad similar to PureScript
  "com.alexknvl"  %%  "sio-eff"            % version,
  // putStrLn etc
  "com.alexknvl"  %%  "sio-teletype"       % version))
  .apply("0.4.0")

License

Code is provided under the MIT license available at https://opensource.org/licenses/MIT, as well as in the LICENSE file.