Skip to content

Instantly share code, notes, and snippets.

View kritzcreek's full-sized avatar

Christoph Hegemann kritzcreek

View GitHub Profile
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"]
module Main where
import Prelude
import Data.Maybe
mystery :: forall a b. (a -> Maybe b) -> Array a -> Array b
mystery = ?x
[
{
name = "base",
repo = "https://github.com/dfinity/motoko-base",
version = "dfx-0.5.13",
dependencies = [] : List Text
}
]
@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
@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
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ImportQualifiedPost #-}
import Protolude
import Control.Concurrent.STM (newTVarIO)

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.