habitat-console


License

License

GroupId

GroupId

com.vsthost.rnd
ArtifactId

ArtifactId

habitat-console_2.12
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

habitat-console
habitat-console
Project URL

Project URL

https://github.com/vst/habitat-console
Project Organization

Project Organization

com.vsthost.rnd
Source Code Management

Source Code Management

https://github.com/vst/habitat-console

Download habitat-console_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.vsthost.rnd/habitat-console_2.12/ -->
<dependency>
    <groupId>com.vsthost.rnd</groupId>
    <artifactId>habitat-console_2.12</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.vsthost.rnd/habitat-console_2.12/
implementation 'com.vsthost.rnd:habitat-console_2.12:0.1.0'
// https://jarcasting.com/artifacts/com.vsthost.rnd/habitat-console_2.12/
implementation ("com.vsthost.rnd:habitat-console_2.12:0.1.0")
'com.vsthost.rnd:habitat-console_2.12:jar:0.1.0'
<dependency org="com.vsthost.rnd" name="habitat-console_2.12" rev="0.1.0">
  <artifact name="habitat-console_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.vsthost.rnd', module='habitat-console_2.12', version='0.1.0')
)
libraryDependencies += "com.vsthost.rnd" % "habitat-console_2.12" % "0.1.0"
[com.vsthost.rnd/habitat-console_2.12 "0.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.7
org.typelevel : cats-core_2.12 jar 1.4.0
org.typelevel : cats-effect_2.12 jar 1.0.0
org.typelevel : cats-tagless-macros_2.12 jar 0.1.0

Project Modules

There are no modules declared in this project.

habitat-console

TODO: Add project description.

Example

import cats.effect._
import cats.implicits._
import com.vsthost.rnd.habitat.console.Console
import com.vsthost.rnd.habitat.console.Console.implicits._

import scala.language.higherKinds

def instructions[F[_]: Sync: Console]: F[Unit] = for {
  _ <- Console[F].putStrLn("Hello!")
  _ <- Console[F].putStr("What is your name?")
  i <- Console[F].readLn[String]
  _ <- i match {
    case Left(e) => Console[F].putErrLn(e)
    case Right(n) => Console[F].putStrLn(s"Nice to meet you $n.")
  }
} yield ()

instructions[IO].unsafeRunSync()

License

Copyright (c) 2018 Vehbi Sinan Tunalioglu <[email protected]>

habitat-console is licensed under Apache 2.0 License.

Versions

Version
0.1.0