Code Monkey home page Code Monkey logo

extras's Introduction

Hi there ๐Ÿ‘‹ I'm Kevin Lee.

Hits

I am a coder, who likes Functional Programming, and mainly use Scala.

I like to develop tools to help ease the pain in my daily tasks and solve real world problems.

๐Ÿ”ญ My Personal Projects

Project Description Repo
whatsub A tool for subtitles (Convert charsets / SMI <=> SRT / Sync) Project Repository
extras Extra tools to make development easier Project Repository
refined4s Newtypes and refinement types for Scala 3 Project Repository
effectie Abstraction for functional effect libraries Project Repository
logger-f Logger for F[_] - Abstraction for logging Project Repository
just-semver Just a Semantic Versioning library for Scala Project Repository
sbt-github-pages Publish GitHub Pages with minimal effort Project Repository
sbt-docusaur sbt plugin for Docusaurus Project Repository
sbt-devoops Upload artifacts and changelog to GitHub Release Project Repository
2020 Hindsight Scala The Good, the Bad and the Ugly Practices in FP Scala
First Day Documents to set up Scala dev environment
maven2sbt A tool to convert Maven pom.xml into sbt build.sbt Project Repository
just-fp A small Functional Programming library Project Repository
j8plus Missing Functional Parts of Java 8 Project Repository
Blog

and more...

These are all my personal projects. I do use Scala at work as well but none is publicly available.

Kevin's GitHub Stats Top Langs
GitHub Streak
Trophy

Readme Card Readme Card

extras's People

Contributors

dependabot[bot] avatar kevin-lee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

extras's Issues

Add a way to test IO[A] - IO[A].completeThen(A => Result): Result

Task

Summary

Add a way to test IO[A] - IO[A].completeThen(A => Result): Result

Project Details

Version: 0.3.0

Description

import CatsEffectRunner._
implicit val ticker: Ticker = Ticker.withNewTestContext()

val expected = n
val actual   = IO(n)

actual.completeThen { actual =>
  actual ==== expected
}

Add all syntax to extras-cats

Task

Summary

Add all syntax to extras-cats

Project Details

Version: unreleased

Description

import extras.cats.syntax.all._

Support Scala.js

Task

Summary

Support Scala.js

Project Details

Version: 0.4.0

Description

[`extras-scala-io`] `Rgb.color("")` and `Rgb.colored("")` should return `""`

Task

Summary

[extras-scala-io] Rgb.color("") and Rgb.colored("") should return ""

Project Details

Version: 0.16.0

Description

Currently, it's like this.

Rgb.unsafeFromInt(0x0000ff).color("")
// String = "\u001b[38;2;0;0;255m"

Rgb.unsafeFromInt(0x0000ff).colored("")
// String = "\u001b[38;2;0;0;255m\u001b[0m"

It should be

Rgb.unsafeFromInt(0x0000ff).color("")
// String = ""

Rgb.unsafeFromInt(0x0000ff).colored("")
// String = ""

[`extras-scala-io`] Add more `String.color` to color syntax

Task

Summary

[extras-scala-io] Add more String.color to color syntax

Project Details

Version: 0.14.0

Description

"some text".black
"some text".red
"some text".green
"some text".yellow
"some text".blue
"some text".magenta
"some text".cyan
"some text".white
"some text".blackBg
"some text".redBg
"some text".greenBg
"some text".yellowBg
"some text".blueBg
"some text".magentaBg
"some text".cyanBg
"some text".whiteBg
"some text".reset
"some text".bold
"some text".underlined
"some text".blink
"some text".reversedColor
"some text".invisible

Add a shorter name method for eitherT

Task

Summary

Add a shorter name method for eitherT (i.e. t)

Project Details

Version: 0.1.0

Description

val fab: F[Either[A, B]] = ???
fab.eitherT // EItherT[F, A, B]
fab.t       // EItherT[F, A, B]
val fab: Either[A, B] = ???
fab.eitherT[F] // EItherT[F, A, B]
fab.t[F]       // EItherT[F, A, B]

Add syntax to support newtype and refined

Task

Summary

Add syntax to support newtype and refined.

Project Details

Version: 0.5.0

Description

e.g.)

import cats.data.NonEmptyList
import eu.timepit.refined.types.string.NonEmptyString
import io.estatico.newtype.macros.newtype

import extras.refinement.syntax.refinement._

@newtype case class Name(value: NonEmptyString)

val name = "Kevin"
validateAs[Name](name) // Right(Name("Kevin"))

name.as[Name].validate // Right(Name("Kevin"))

val emptyString = ""
validateAs[Name](emptyString) // Left(NonEmptyList("error message"))

emptyString.as[Name].validate // Left(NonEmptyList("error message"))

This idea is from Practical FP in Scala.

Add the doc site

Task

Summary

Add the doc site

Project Details

Version: 0.1.0

Description

[`extras-scala-io`] Add `Rgb` to have true color support

Task

Summary

Add Rgb to have true color support

Project Details

Version: 0.15.0

Description

Rgb.fromInt(0x000000) // Right(Rgb(0))
Rgb.fromInt(0xff0000) // Right(Rgb(16711680))
Rgb.fromInt(0x00ff00) // Right(Rgb(65280))
Rgb.fromInt(0x0000ff) // Right(Rgb(255))
Rgb.fromInt(0xffffff) // Right(Rgb(16777215))

Add syntax for testing Future

Task

Summary

Add syntax for testing Future

Project Details

Version: 0.1.0

Description

val fa: Future[A] = ???
fa.toValue // A

Add Scalafix check

Task

Summary

Add Scalafix check

Project Details

Version: 0.4.0

Description

Add a way to test IO[A] with error - IO[A].errorThen(Throwable => Result): Result

Task

Summary

Add a way to test IO[A] with error - IO[A].errorThen(Throwable => Result): Result

Project Details

Version: 0.3.0

Description

import CatsEffectRunner._
implicit val ticker: Ticker = Ticker.withNewTestContext()

val expected = new RuntimeException("Some error")
val actual   = IO.raiseError[Int](error)

actual.errorThen { actual =>
  actual ==== expected
}

[`extras-scala-io`] Add: Run with temporary directory - runWithTempDir

Task

Summary

Add runWithTempDir

Project Details

Version: 0.11.0

Description

TempFiles.runWithTempDir("testRunWithTempDir") { tempDir =>
  // do something with the temporary directory
  123
} // it automatically deletes the tempDir including everything inside
// Either[Throwable, Int] = Right(123)
TempFiles.runWithTempDir("testRunWithTempDir") { tempDir =>
  // do something with the temporary directory
  throw new MyException("blah")
  // ...
  123
} // it automatically deletes the tempDir including everything inside
// Either[Throwable, Int] = Left(MyException("Blah"))

[`extras-scala-io`] Add `color` and `colored` to `Color`

Task

Summary

[extras-scala-io] Add color and colored to Color

Project Details

Version: 0.16.0

Description

Color.blue.color("blah")
// \u001b\u005b\u0033\u0034\u006dblah

Color.blue.colored("blah")
// \u001b\u005b\u0033\u0034\u006dblah\u001b\u005b\u0030\u006d

Change extension method for refinement type + newtype from `value.as[A].validate` to `value.validateAs[A]`

Task

Summary

Change extension method for refinement type + newtype from value.as[A].validate to value.validateAs[A].

Project Details

Version: 0.6.0

Description

Although having one extension method without partially application may cause IntelliJ IDEA highlighting it as compilet-time error, there's no actual compile-time error for that syntax.

@newtype case class Name(value: NonEmptyString)

type PositiveInt = Int Refined Positive
object PositiveInt extends RefinedTypeOps[PositiveInt, Int]
@newtype case class Id(value: PositiveInt)

final case class Person(id: Id, name: Name)

val id  = idValue.validateAs[Id]
val name  = nameValue.validateAs[Name]

(id, name).parMapN(Person.apply)

Add extras-scala-io

Task

Summary

Add extras-scala-io

Project Details

Version: 0.1.0

Description

It should have.

  • Typed version of scala.io.AnsiColor (#26)
  • ColorSyntax for typed AnsiColor (#27)
  • CanClose[A] type class as an alternative to AutoCloseable (#28)
  • Write CanClose type class instance for scala.io.Source (#29)

[`extras-scala-io`] `"".rgb` and `"".rgbed` should return `""`

Task

Summary

[extras-scala-io] "".rgb and "".rgbed should return ""

Project Details

Version: 0.16.0

Description

"".rgb(0x0000ff)
// String = "\u001b[38;2;0;0;255m"

"".rgbed(0x0000ff)
// String = "\u001b[38;2;0;0;255m\u001b[0m"

It should be

"".rgb(0x0000ff)
// String = ""

"".rgbed(0x0000ff)
// String = ""

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.