Skip to content

Instantly share code, notes, and snippets.

View hasufell's full-sized avatar
👀
Staring

Julian Ospald hasufell

👀
Staring
View GitHub Profile
@hasufell
hasufell / cabal-sandbox.md
Created June 10, 2024 13:33
Revive cabal sandboxes

Motivation

At ZuriHac 2024 we (@andreabedini, myself and others) talked with @ivanperez-keera and @fdedden about the user experience of using GHC and cabal for people who are not Haskell developers and are not interested in Haskell on its own, but rather use it to:

  • build a package
  • use a framework/library that requires Haskell (e.g. copilot)

These users are not interested in:

  • nix
globalTools:
ShimGen:
dlUri: https://downloads.haskell.org/~ghcup/shimgen/shim-2.exe
dlHash: 7c55e201f71860c5babea886007c8fa44b861abf50d1c07e5677eb0bda387a70
toolRequirements: {}
ghcupDownloads:
GHC:
9.6.0.20220102:
viArch:
A_64:
@hasufell
hasufell / CLC_manifesto.md
Last active March 1, 2023 06:48
Haskell CLC manifesto (Julian Ospald)

Manifesto

Here is my baseline on the API and maintenance of 'base', from which contributors can derive my potential support wrt proposals in advance (to some extent).

Purpose of base

The purpose of base is for providing a fairly stable interface of a standard library that follows:

@hasufell
hasufell / github.md
Last active October 18, 2022 12:47
Migrating tooling to github / providing github action runners to Haskell infrastructure

Migrating tooling to github / providing github action runners to Haskell infrastructure

Current state

  1. GHCup relies on Gitlab CI for testing and releases
  2. GHCup maintainers also use Gitlab CI to build darwin M1 stack binaries
  3. HLS and Cabal rely on Gitlab CI for releases only
  4. projects like bytestring rely on very slow emulation on github actions or other semi-private runners

The problem

mapKey <e:v> j
mapKey <o:v> k
mapKey <n:v> h
mapKey <i:v> l
mapKey <h:v> e
mapKey <c-c> <c-[>
# Insert your preferred key mappings here.
package haskell-language-server
flags: -floskell -fourmolu -ormolu -stylishHaskell -changeTypeSignature -gadt -selectionRange -alternateNumberFormat -splice -moduleName -tactic -retrie -rename -importLens -eval -class
@hasufell
hasufell / correctness.md
Last active June 24, 2022 16:57
AFPP and correctness

Correctness issues with current String based filepath handling

Context

On unix, the base library uses getFileSystemEncoding and mkTextEncoding to pick a round-trippable encoding for filepaths. E.g. if your locale returns en_US.UTF-8 you'll get UTF-8//ROUNDTRIP TextEncoding, which is based on PEP 383.

@hasufell
hasufell / Playground.hs
Last active November 28, 2021 04:56
Plutus Playground Smart Contract
import Control.Monad (void)
import Data.Aeson (FromJSON, ToJSON)
import qualified Data.Text as T
import GHC.Generics (Generic)
import Language.Plutus.Contract
import qualified Language.PlutusTx as PlutusTx
import Language.PlutusTx.Prelude
import Ledger
import qualified Ledger.Ada as Ada
import qualified Ledger.Constraints as Constraints
-- https://docs.rs/ansi_term/0.12.1/x86_64-pc-windows-msvc/src/ansi_term/windows.rs.html#10-61
enableAnsiSupport :: IO (Either String Bool)
enableAnsiSupport = handleIO (pure . Left . displayException) $ do
h <- createFile "CONOUT$" (gENERIC_WRITE .|. gENERIC_READ) fILE_SHARE_WRITE Nothing oPEN_EXISTING 0 Nothing
when (h == iNVALID_HANDLE_VALUE ) $ fail "invalid handle value"
m <- getConsoleMode h
if ((m .&. eNABLE_VIRTUAL_TERMINAL_PROCESSING) == 0)
then setConsoleMode h (m .|. eNABLE_VIRTUAL_TERMINAL_PROCESSING) >> pure (Right True)
else pure (Right False)
#!/bin/sh
# Main settings:
# * BOOTSTRAP_HASKELL_NONINTERACTIVE - any nonzero value for noninteractive installation
# * BOOTSTRAP_HASKELL_NO_UPGRADE - any nonzero value to not trigger the upgrade
# * GHCUP_USE_XDG_DIRS - any nonzero value to respect The XDG Base Directory Specification
# * BOOTSTRAP_HASKELL_VERBOSE - any nonzero value for more verbose installation
# * BOOTSTRAP_HASKELL_GHC_VERSION
# * BOOTSTRAP_HASKELL_CABAL_VERSION