This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// MetalSwiftUI | |
// | |
// Created by Zach Eriksen on 9/8/20. | |
// Copyright © 2020 oneleif. All rights reserved. | |
// | |
// Inspired [MetalUI](https://github.com/0xLeif/MetalUI) | |
import SwiftUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Data.Map.Strict (Map) | |
import qualified Data.Map.Strict as M | |
import MonadLib | |
type Tables t a = (PrefixMap t a, InfixMap t a) | |
newtype PrattM t r a = PrattM | |
{ runPrattM :: ReaderT (Tables t r) (StateT [t] (ExceptionT String Id)) a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
billy gets 🎁 | |
jill gets 💩 | |
Jen gets 🎁 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PUNCTUATION = "" + | |
"’'" + // apostrophe | |
"()[]{}<>" + // brackets | |
":" + // colon | |
"," + // comma | |
"‒–—―" + // dashes | |
"…" + // ellipsis | |
"!" + // exclamation mark | |
"." + // full stop/period | |
"«»" + // guillemets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pivot(_, [], [], []). | |
pivot(Pivot, [Head|Tail], [Head|LessOrEqualThan], GreaterThan) :- Pivot >= Head, pivot(Pivot, Tail, LessOrEqualThan, GreaterThan). | |
pivot(Pivot, [Head|Tail], LessOrEqualThan, [Head|GreaterThan]) :- pivot(Pivot, Tail, LessOrEqualThan, GreaterThan). | |
quicksort([], []). | |
quicksort([Head|Tail], Sorted) :- pivot(Head, Tail, List1, List2), quicksort(List1, SortedList1), quicksort(List2, SortedList2), append(SortedList1, [Head|SortedList2], Sorted). |