Skip to content

Instantly share code, notes, and snippets.

View adituv's full-sized avatar

Iris Ward adituv

View GitHub Profile
@adituv
adituv / demoteNat.hs
Created December 4, 2017 03:22
No proxies thanks to -XTypeApplications!
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
@adituv
adituv / Text.hs
Created January 4, 2018 07:24
Text to Foundation's String
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeFamilies #-}
module Foundation.Interop.Text where
import Foundation
import Foundation.Array
import Foundation.Bits
import Foundation.Collection
@adituv
adituv / Ratio.hs
Created January 26, 2018 01:29
Show ratios as a mixed fraction
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Text.Show.Ratio(showMixed, showsMixed, showsPrecMixed) where
import Data.Ratio
-- | Convert a @'Ratio' a@ to a readable string, where the ratio is
-- expressed as a mixed fraction in its simplest form. `showsPrecMixed`
-- is designed for use as part of another show implementation, and so
@adituv
adituv / README.md
Last active January 9, 2019 16:37
Triple Triad Card Data (Patch 4.5)
@adituv
adituv / bizhawk-shim.lua
Last active February 20, 2024 03:07
Bizhawk shim for VBA-rr lua scripts
-- VBA/Bizhawk shim, to allow lua scripts written for VBA-rr to run in BizHawk.
-- Copy and paste this script into the start of a VBA-rr script to make it run in
-- BizHawk with no further modifications.
-- Changes to BizHawk's built-in tables persist while the lua console window is open.
-- Make sure we don't copy our already-updated objects.
if type(joypad.get) == "userdata" then
bizJoypad = copytable(joypad)
end