Skip to content

Instantly share code, notes, and snippets.

View kritzcreek's full-sized avatar

Christoph Hegemann kritzcreek

View GitHub Profile

My latest attempt at installing and using cabal on Windows:

Installation via choco fails.

C:\WINDOWS\system32>choco install ghc --version 8.10.7
Chocolatey v0.11.2
Installing the following packages:
ghc
By installing, you accept licenses for the packages.
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ImportQualifiedPost #-}
import Protolude
import Control.Concurrent.STM (newTVarIO)
@kritzcreek
kritzcreek / Main.purs
Created December 19, 2020 11:22
Decoding mixed Json
module Main where
import Prelude
import Effect (Effect)
import Data.Either (Either(..))
import Data.Traversable (traverse)
import TryPureScript (render, withConsole)
import Type.Row (type (+))
import Data.Argonaut as A
@kritzcreek
kritzcreek / Main.purs
Created December 3, 2020 12:10
Pagination Example
module Main where
import Prelude
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Effect.Class.Console as Console
import Effect.Ref (Ref)
import Effect.Ref as Ref
[
{
name = "base",
repo = "https://github.com/dfinity/motoko-base",
version = "dfx-0.5.13",
dependencies = [] : List Text
}
]
module Main where
import Prelude
import Data.Maybe
mystery :: forall a b. (a -> Maybe b) -> Array a -> Array b
mystery = ?x
module Main where
import Prelude
import Data.Map as Map
import Data.Tuple (Tuple(..))
myMap :: Map.Map Int String
myMap = Map.fromFoldable [Tuple 1 "Hi"]
import Prelude
import Control.Monad
import Data.Foldable
import Language.PureScript.CST.Types as CST
import Language.PureScript.CST.Parser as CST
import Language.PureScript.CST.Print as CST
import Data.Text (Text)
import Data.Text.IO as Text
import System.Directory
import System.FilePath
[package]
name = "cont-rs"
version = "0.1.0"
authors = ["kRITZCREEK <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sexp = "1"
module Sexp.Codec
( SexpDecodeError(..)
, sexp
, boolean
, number
, int
, string
, array
) where