Skip to content

Instantly share code, notes, and snippets.

View AlecsFerra's full-sized avatar
👾
λ

Alessio AlecsFerra

👾
λ
View GitHub Profile
@AlecsFerra
AlecsFerra / PolyRecord.hs
Created May 7, 2024 18:54
WIP not working
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
import Data.Data (Proxy (Proxy))
import Data.Kind (Type)
import Text.Printf (printf)
@AlecsFerra
AlecsFerra / flatten.py
Created June 27, 2024 16:59
Transform a LaTeX project using \import and \subimport in a standalone LaTeX file
#! /usr/bin/env python3
# flatten.py
# Copyright (C) 2024 Alessio Ferrarini <github.com/alecsferra>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@AlecsFerra
AlecsFerra / cmd.nix
Created September 2, 2024 08:34
Run eduroam installers on NixOS
nix-shell -p "python3.withPackages (ps: with ps; [ dbus-python distro ])" --run "python3 <your-eduroam.py>"
@AlecsFerra
AlecsFerra / SKIDC.hs
Last active November 22, 2024 14:40
Implementation in LH of A correct-by-construction conversion from lambda calculus to combinatory logic
// Implementation in LH of A correct-by-construction conversion from lambda calculus to combinatory logic
// https://webspace.science.uu.nl/~swier004/publications/2023-jfp.pdf
{-# Language GADTs #-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--full" @-}
{-@ LIQUID "--max-case-expand=4" @-}
{-@ LIQUID "--etabeta" @-}
@AlecsFerra
AlecsFerra / Proposal.md
Created October 7, 2024 11:05
LiquidHaskell proposal for local unfoldings

Local Definitions Proposal

The Issue

Suppose we are working with the following Liquid Haskell code:

{-@ LIQUID "--ple" @-}
{-@ LIQUID "--reflection" @-}
@AlecsFerra
AlecsFerra / CCDep.hs
Last active January 13, 2025 09:58
Implementation in LH of Calculating Dependently-Typed Compilers
-- Implementation in LH of Calculating Dependently-Typed Compilers
-- https://people.cs.nott.ac.uk/pszgmh/well-typed.pdf
{-# LANGUAGE GADTs #-}
{-# OPTIONS_GHC -fplugin=LiquidHaskell #-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--max-case-expand=4" @-}
@AlecsFerra
AlecsFerra / ExprCompiler.hs
Created November 22, 2024 15:07
Correct by construction stack compiler in LH
{-# LANGUAGE GADTs #-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--dependantcase" @-}
module ExprCompiler where
import Language.Haskell.Liquid.ProofCombinators