Skip to content

Instantly share code, notes, and snippets.

View Miso - Raison D'être.md

Raison D'être - miso

Miso was written for those who want the simplicity of an Elm interface without sacrificing typeclasses and allowing type-sharing between server and client.

Type sharing

A lot of web dev becomes boilerplate -- serializing and transferring state is a large part of the work of web dev. Type sharing ensures correct-by-construction serialization between server / client amidst any changes to your business logic data types, allows you to focus on your apps core offerings as opposed to minutia.

Rich ecosystem

The Haskell ecosystem has many great libraries that compile w/o any problems on the frontend.

View Main.hs
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
module Main where
View linker.patch
diff --git a/rts/Linker.c b/rts/Linker.c
index 7bd2e67278..6d54b60793 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -338,33 +338,33 @@ int ghciInsertSymbolTable(
call this function again to trigger the duplicate error. */
return 1;
}
-
- pathchar* archiveName = NULL;
View main.cpp
#include <stdio.h>
#include <iostream>
#include <memory>
typedef std::unique_ptr<int> Ptr;
int main()
{
printf("Hello, world!\n");
std::cout << "hey" << std::endl;
View Main.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as BL8
import qualified Data.Csv as CSV
import Data.List
import qualified Data.Vector as V
View build.sh
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use haskell-miso
git clone https://github.com/dmjio/miso
cd miso
nix-build -A miso-arm
View ff.csv
We can't make this file beautiful and searchable because it's too large.
View CEnumToHsc2HsEnum.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
module Main where
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import Data.Char
import Data.List
View install-nixos.sh
parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart primary 512MiB -8GiB
parted /dev/nvme0n1 -- mkpart primary linux-swap -8GiB 100%
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
parted /dev/nvme0n1 -- set 3 boot on
cryptsetup luksFormat /dev/nvme0n1p1
cryptsetup luksOpen /dev/nvme0n1p1 cryptroot
mkfs.ext4 -L nixos /dev/mapper/cryptroot
mkswap -L swap /dev/nvme0n1p2
mkfs.fat -F 32 -n boot /dev/nvme0n1p3
View install-nixos.sh
# parted /dev/nvme0n1 -- mklabel gpt
# parted /dev/nvme0n1 -- mkpart primary 512MiB -8GiB
# parted /dev/nvme0n1 -- mkpart primary linux-swap -8GiB 100%
# parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
# parted /dev/nvme0n1 -- set 3 boot on
# mkfs.ext4 -L nixos /dev/nvme0n1p1
# mkswap -L swap /dev/nvme0n1p2
# mkfs.fat -F 32 -n boot /dev/nvme0n1p3
# mount /dev/disk/by-label/nixos /mnt