Download and install talosctl binary
wget https://github.com/talos-systems/talos/releases/download/v0.8.1/talosctl-linux-amd64| object Streaming { | |
| sealed trait Pull[O, R]{ self => | |
| protected def step: Eval[Either[R, (O, Pull[O, R])]] | |
| def map[R2](f: R => R2): Pull[O, R2] = flatMap(r => Pull.pure(f(r))) | |
| def flatMap[R2](f: R => Pull[O, R2]): Pull[O, R2] = new Pull[O, R2]{ | |
| protected def step: Eval[Either[R2, (O, Pull[O, R2])]] = { | |
| Eval.defer(self.step).flatMap{ |
This document is targeted at those who seek to build reproducible dev environment across machines, OS, and time.
It maybe easier for remote teams to work together and not spending hours each person setting up asdf/pyenv/rbenv, LSP servers, linters, runtime/libs. Nix is probably the closest thing to Docker in terms of development environment.
Flake is used here because it provides hermetic build, with absolutely no reliance on system environment (be it Arch/Catalina/Mojave). Also it freezes dependencies in flake.lock so builds are reproducible.
This gist provides the setup to develop Java/Clojure/Python applications on Nix. But it can be easily adapted to ruby, nodejs, haskell.
| import com.sksamuel.avro4s.SchemaFor | |
| import com.sksamuel.avro4s.refined._ | |
| import io.estatico.newtype.Coercible | |
| import io.chrisdavenport.fuuid.FUUID | |
| import java.util.UUID | |
| import scala.concurrent.duration.FiniteDuration | |
| import io.circe.{Json, JsonObject} | |
| import com.comcast.ip4s.Ipv4Address | |
| object avro extends SchemaForCoercible { |
| import cats._ | |
| import cats.implicits._ | |
| import cats.effect._ | |
| import cats.effect.implicits._ | |
| import scala.concurrent.duration._ | |
| import io.chrisdavenport.mapref._ | |
| trait SetOnceCache[F[_], K, V]{ | |
| def get(k: K): F[V] |
| import cats._ | |
| import cats.syntax.all._ | |
| import cats.data._ | |
| import cats.effect._ | |
| import cats.effect.syntax.all._ | |
| import cats.effect.std.Semaphore | |
| trait Lock[F[_]]{ self => | |
| def lock: F[Unit] | |
| def unlock: F[Unit] |
| ### | |
| ### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places. | |
| ###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of | |
| ###. things to watch out for: | |
| ### - Check out the `nix-darwin` instructions, as they have changed. | |
| ### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026 | |
| ### | |
| # I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
| # So here's a minimal Gist which worked for me as an install on a new M1 Pro. |
Think of all the arguments you've heard as to why static typing is desirable — every single one of those arguments applies equally well to using types to represent error conditions.
An odd thing I’ve observed about the Scala community is how many of its members believe that a) a language with a sophisticated static type system is very valuable; and b) that using types for error handling is basically a waste of time. If static types are useful—and if you like Scala, presumably you think they are—then using them to represent error conditions is also useful.
Here's a little secret of functional programming: errors aren't some special thing that operate under a different set of rules to everything else. Yes, there are a set of common patterns we group under the loose heading "error handling", but fundamentally we're just dealing with more values. Values that can have types associated with them. There's absolutely no reason why the benefits of static ty
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE DerivingVia #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| module Test where | |
| import Control.Monad.Reader | |
| import Data.Generics.Product.Typed |
| {-# LANGUAGE GADTs, DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| module Main where | |
| import Data.Typeable (cast) | |
| import Type.Reflection |