- Alejando Serrano (47 Degrees)
- Searching for one ;)
@use '_share/src/zindex' as zindex; | |
@use '_share/src/Platform2/colors' as P2Colors; | |
@use '_share/src/Platform2/Scrollbar/style' as Scrollbar; | |
@mixin autocomplete { | |
&--search-icon { | |
margin-left: -8px; | |
margin-right: -4px; | |
height: 32px; | |
} |
-- Traversables as Graded functors | |
-- Graded functors as functors that commute with grading | |
-- | |
-- Graded endofunctors on KleisliApp are Traversables | |
-- | |
-- Laws omitted. | |
module T where | |
open import Level |
#!/usr/bin/env node | |
// the .mjs extension is important | |
// run this inside the directory containing the `elm.json` file | |
// (if it's not executable, run `chmod +x elm-build-cache.mjs`) | |
// with VERBOSE=1 env var it will show you results of the exec commands | |
import fs from 'fs/promises'; | |
import {exec} from 'child_process'; |
-- | In response to https://twitter.com/_gilmi/status/1478846678409035779 | |
-- | |
-- The challenge is three-fold: | |
-- | |
-- 1. define the type 'Expr2' as "the same as 'Expr1' but with this constructor | |
-- instead of that one", without having to repeat all the other constructors. | |
-- 2. convert from 'Expr1' to 'Expr2' by only providing a translation for the | |
-- one constructor which is different. | |
-- 3. write a polymorphic function which works with both 'Expr1' and 'Expr2' | |
-- because it doesn't touch the constructor which differs. |
{-# LANGUAGE BlockArguments #-} | |
module Main where | |
main :: IO () | |
main = do | |
babyShark | |
do do do do do do babyShark | |
do do do do do do babyShark | |
do do do do do do babyShark |
package adt; | |
public class ADT { | |
// sealed is an experimental feature (requrires feature preview flag) of Java 15 | |
public sealed interface Expr | |
permits Const, Plus, Times { | |
} | |
// records in Java 15 | |
// records are Scala's Case Class (I'll admit Record is a much better and more accurate name!) |
{- Derive Monad for a type like @Pipe@, which is isomorphic to a @Free@ monad | |
@ | |
data Pipe i o a | |
= Input (i -> Pipe i o a) | |
| Output o (Pipe i o a) | |
| Return a | |
deriving Generic | |
@ |
module ChrisPenner where | |
import Data.Array ((!)) | |
import Data.Foldable (for_, foldl', maximumBy) | |
import Data.List (sort) | |
import Data.Map.Strict (Map) | |
import Data.Ord (comparing) | |
import qualified Data.Array as A | |
import qualified Data.Map.Strict as Map |
{-# LANGUAGE RankNTypes #-} | |
module Optics where | |
import Control.Category ((>>>)) | |
import qualified Control.Category as Cat | |
import Control.Effect.Empty | |
import Control.Effect.NonDet hiding (empty) | |
import Control.Monad ((<=<)) | |
-- riffing off of @serras’s post https://gist.github.com/serras/5152ec18ec5223b676cc67cac0e99b70 |