vyorkin Is there any tutorial / blog post explaining the basics of type-level ? I mean RowCons and things in typelevel-prelude. I’m reading https://liamgoodacre.github.io/purescript/2017/05/27/row-lacks.html and I think I’ve got the basic idea of how it works, but I can’t understand the implementation. This is a quick post about the new RowLacks type class that was added to purescript-typelevel-prelude. This can be used to require that a row does not contai...  vyorkin For example its hard for me to understand what is going on here: https://github.com/purescript/purescript-typelevel-prelude/blob/master/src/Type/Data/Boolean.purs#L40
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
module Main where | |
import Prelude | |
import Data.Enum (upFrom) | |
import Data.List (List) | |
import Data.Map (fromFoldable, lookup) as Map | |
import Data.Maybe (Maybe) | |
import Data.Tuple.Nested ((/\)) | |
import Data.Variant (Unvariant(..), Variant, unvariant) |
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
module Main where | |
import Prelude | |
import Data.Enum (upFrom) | |
import Data.Foldable (fold) | |
import Data.Generic.Rep (Constructor, Sum) as Generic.Rep | |
import Data.Generic.Rep (class Generic) | |
import Data.List (List) | |
import Data.Map (fromFoldable, lookup) as Map |
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
module Main where | |
import Data.Lens (set, view) as Lens | |
import Data.Lens.Record (prop) | |
import Data.Profunctor.Strong (class Strong) | |
import Heterogeneous.Folding (class FoldingWithIndex, class HFoldlWithIndex, hfoldlWithIndex) | |
import Prim.Row (class Cons, class Lacks) as Row | |
import Prim.RowList (class RowToList) as RL | |
import Record (insert) as Record | |
import Type.Prelude (class IsSymbol) |
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
module Main where | |
import TryPureScript (p, text, render) | |
import Prelude | |
import Data.Generic.Rep (class Generic) | |
import Data.Show.Generic (genericShow) | |
data Route = Home | Users String | User Int | NotFound String |
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
module Main where | |
import Prelude | |
import Prim.RowList (Cons, Nil) as RL | |
import Prim.RowList (class RowToList, RowList) | |
import Type.Data.Row (RProxy(..)) | |
class IterProps (given ∷ RowList Type) |
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
module Main where | |
import Prelude | |
import Data.Foldable (fold) | |
import Effect (Effect) | |
import TryPureScript (h1, h2, p, text, list, indent, link, render, code) | |
import Record (merge) as Record | |
import Data.Variant (inj, match, Variant) | |
import Data.Maybe (fromMaybe, Maybe(..)) |
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
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.stdenv.mkDerivation rec { | |
pname = "purty"; | |
version = "7.0.0"; | |
src = pkgs.fetchurl { | |
url = "https://registry.npmjs.org/purty/-/purty-${version}.tgz"; | |
sha256 = "1h9z43aj1gflysy0379j7cpdvszjlk9lvg861hgk7dmqq59qzd4y"; | |
}; |
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
module Main where | |
import Type.Row (type (+)) | |
type Row_ab r = ( a :: String, b :: Int | r) | |
type Row_c r = (c :: Boolean | r) | |
type Row_d r = (d :: Number | r) |
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
module Main where | |
import Data.Functor (map) | |
import Data.Monoid ((<>)) | |
import Data.Variant (expand, Variant) | |
import Prim.Row (class Union) | |
combine :: forall v v_ w w_ u. Union w w_ u => Union v v_ u => | |
Array (Variant v) | |
-> Array (Variant w) |