This file contains 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 ForScalaz { | |
type CoyonedaF[F[_]] = ({type A[α] = Coyoneda[F, α]}) | |
def FG_to_CFG[F[_], G[_] : Functor, A](t: F ~> G): (CoyonedaF[F]#A ~> G) = { | |
type CF[A] = Coyoneda[F, A] | |
type CG[A] = Coyoneda[G, A] | |
val m: (CF ~> CG) = FG_to_CFCG(t) | |
val n: (CG ~> G) = CF_to_F | |
val o: (CF ~> G) = n compose m |
This file contains 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
package scalaz.stream.merge | |
import scalaz.\/ | |
import scalaz.stream.merge.Junction._ | |
import scalaz.stream.Process._ | |
object JunctionExperiment { | |
val debug = !true |
This file contains 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
case class Username(value: String) | |
implicit val usernameCodec = implicitly[CodecJson[String]].xmap(Username.apply)(_.value) | |
// ------------------------------------------------------------------------------------------------ | |
// Would like to eventually like to do something like this: | |
// (Basically a replacement the {@@, T with U} hack which has caused me too many problems) | |
trait TaggedType { type U; def value: U } | |
trait TaggedTypeCtor[T <: TaggedType] { def apply(u: T#U): T } |
This file contains 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
package lib { | |
trait O[A] | |
object O { | |
import F.I | |
implicit val Il = null.asInstanceOf[I[Long]] | |
implicit val Ol = null.asInstanceOf[O[Long]] | |
} | |
trait T { |
This file contains 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
#!/bin/bash | |
find . -name '*.scala' -exec perl -pi -e ' | |
s/(?!<[a-zA-Z0-9_"])onblur(?![a-zA-Z0-9_"])/onBlur/g; | |
s/(?!<[a-zA-Z0-9_"])onchange(?![a-zA-Z0-9_"])/onChange/g; | |
s/(?!<[a-zA-Z0-9_"])onclick(?![a-zA-Z0-9_"])/onClick/g; | |
s/(?!<[a-zA-Z0-9_"])ondblclick(?![a-zA-Z0-9_"])/onDblClick/g; | |
s/(?!<[a-zA-Z0-9_"])onfocus(?![a-zA-Z0-9_"])/onFocus/g; | |
s/(?!<[a-zA-Z0-9_"])onkeydown(?![a-zA-Z0-9_"])/onKeyDown/g; | |
s/(?!<[a-zA-Z0-9_"])onkeyup(?![a-zA-Z0-9_"])/onKeyUp/g; |
This file contains 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 scala.language._ | |
import scala.annotation.tailrec | |
object Blah { | |
val errmsg = """ | |
[error] found : blah.webapp.client.lib.ui.Editor[(blah.webapp.base.data.Validators.blar.scala.S, (String, String, blah.webapp.base.data.ImplicationRequired)),blah.webapp.client.app.ui.CfgBlars.fields.FieldValue,scalaz.effect.IO,blah.webapp.client.app.ui.CfgBlars.storesAndState.S,blah.webapp.client.app.ui.CfgBlars.fields.Field,scalaz.effect.IO[Unit],(japgolly.scalajs.react.vdom.ReactVDom.Tag, japgolly.scalajs.react.vdom.ReactVDom.Tag, japgolly.scalajs.react.vdom.prefix_<^.Tag)] | |
[error] (which expands to) blah.webapp.client.lib.ui.Editor[((Stream[blah.webapp.base.data.CustomBlar], Option[blah.webapp.base.data.CustomBlar.Id]), (String, String, blah.webapp.base.data.ImplicationRequired)),blah.webapp.client.app.ui.CfgBlars.fields.FieldValue,scalaz.effect.IO,blah.webapp.client.app.ui.CfgBlars.storesAndState.State,blah.webapp.client.app.ui.CfgBlars.fields.Field,scalaz.effect.IO[Unit],(japgolly.scalajs.react.vdom.ReactV |
This file contains 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
// In Link & MenuItem, when onClick is None it means it should be disabled. | |
// This enforces the invariant that disabled items cannot be clicked. | |
// If you want something clickable but you want it to do nothing then pass it | |
// a callback that does nothing: Some(IO(())) | |
sealed trait NavItem | |
case class Link(label: String, onClick: Option[IO[Unit]], active: Boolean) extends NavItem | |
case class DropdownMenu(items: NonEmptyList[MenuItem]) extends NavItem |
This file contains 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
package shipreq.webapp.client.lib | |
import org.scalajs.dom.console | |
import scala.annotation.elidable | |
import scala.scalajs.js | |
import scalaz.effect.IO | |
import js.{UndefOr, undefined} | |
trait ConsoleIO { | |
def info (msg: js.Any, extra: js.Any*) : IO[Unit] |
This file contains 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 japgolly.scalajs.react._, vdom.prefix_<^._, ScalazReact._ | |
import japgolly.scalacss.Defaults._ | |
import japgolly.scalacss.ScalaCssReact._ | |
import shapeless.syntax.singleton._ | |
object CssPager { | |
type CLICKEVENT = Int => Unit | |
object Style extends StyleSheet.Inline { |
This file contains 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 sbt._ | |
import scala.languageFeature._ | |
import org.scalajs.sbtplugin.ScalaJSPlugin | |
import ScalaJSPlugin.autoImport._ | |
object DependencyLib { | |
sealed trait HasDialect | |
sealed trait HasJvm extends HasDialect | |
sealed trait HasJs extends HasDialect |
OlderNewer