This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Siren | |
| open System | |
| open Hypermedia.Models | |
| type Rel = Rel of string | |
| type Title = Title of string | |
| type Class = Class of string | |
| type MediaType = MediaType of string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#@ template debug="false" hostspecific="false" language="C#" #> | |
| <#@ assembly name="System.Core" #> | |
| <#@ import namespace="System.Linq" #> | |
| <#@ import namespace="System.Text" #> | |
| <#@ import namespace="System.Collections.Generic" #> | |
| <#@ output extension=".cs" #> | |
| //------------------------------------------------------------------------------ | |
| // <auto-generated> | |
| // This code was generated by a tool. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cats.data.State | |
| object PRNG { | |
| final case class Seed(seed: Long) { | |
| private lazy val next = Seed(seed * 6364136223846793005L + 1442695040888963407L) | |
| def nextInt: (Seed, Int) = { | |
| (next, (next.seed >>> 16).asInstanceOf[Int]) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Note: pure != good, this is just a demo for the sake of purity. There are no claims that this is a particularly good design. | |
| import PRNG.Seed | |
| import cats.data.{State, StateT} | |
| import cats.effect._ | |
| import scala.util.Try | |
| object DiceGame extends App { | |
| type StateIO[A] = StateT[IO, Seed, A] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint", "-g:none") | |
| resolvers += Resolver.sonatypeRepo("releases") | |
| val http4sVersion = "0.18.0" | |
| val circeVersion = "0.9.1" | |
| val catsEffectVersion = "0.9" | |
| libraryDependencies ++= Seq( | |
| "org.http4s" %% "http4s-dsl" % http4sVersion exclude ("org.typelevel", "cats-effect_2.12"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Types.Interval exposing (IntervalSize(..), IntervalQuality(..), Interval, addIntervalSizeToLetter, noteLetterDistance, addIntervalToNote, perfectUnison, minorSecond, majorSecond, minorThird, majorThird, perfectFourth, augmentedFourth, diminishedFifth, perfectFifth, minorSixth, majorSixth, minorSeventh, majorSeventh) | |
| import Types.Note exposing (..) | |
| import List.Extra | |
| type IntervalSize | |
| = Unison | |
| | Second | |
| | Third |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| port module Ports exposing (Header, Part, FileUploadRequest, uploadProgress, uploadFile) | |
| import Json.Decode exposing (Value) | |
| port uploadFile : { elementId : ElementId, request : FileUploadRequest } -> Cmd msg | |
| port uploadProgress : (Value -> msg) -> Sub msg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import $ivy.`com.github.battermann::pureapp:0.6.0` | |
| import com.github.battermann.pureapp._ | |
| import com.github.battermann.pureapp.interpreters.Terminal._ | |
| import cats.effect.IO | |
| import cats.implicits._ | |
| import scala.util.Try | |
| object Main extends StandardPureApp[IO] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module MusicTheory.Music exposing | |
| ( Control(..) | |
| , Division(..) | |
| , Duration(..) | |
| , Music(..) | |
| , Primitive(..) | |
| , PrimitiveGroup(..) | |
| , TiedOrSeparate(..) | |
| , dotted | |
| , eighth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object SameGame { | |
| final case class Position(col: Int, row: Int) | |
| sealed trait Color | |
| case object Green extends Color | |
| case object Blue extends Color | |
| case object Red extends Color | |
| case object Brown extends Color | |
| case object Gray extends Color |