- What's a recipe?
- What's a target?
- What's a rule?
- What's that `.PHONY` thing? What's that `.DEFAULT_GOAL` thing?
This file contains hidden or 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 BlockArguments #-} | |
| {-# LANGUAGE Rank2Types #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# OPTIONS_GHC -Wall -Werror -Wextra -Wno-name-shadowing #-} | |
| module HyperList where | |
| import Data.Function ((&)) | |
| newtype a -&> b = Hyp {invoke :: (b -&> a) -> b} |
This file contains hidden or 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 BlockArguments #-} | |
| {-# LANGUAGE Rank2Types #-} | |
| {-# OPTIONS_GHC -Wall -Werror -Wextra -Wno-name-shadowing #-} | |
| module HyperPhases where | |
| import Control.Applicative (liftA2) | |
| import Data.Functor ((<&>)) | |
| newtype Phases f a = Phases |
This file contains hidden or 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 BlockArguments #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# OPTIONS_GHC -Wall -Werror -Wextra #-} | |
| module Hyperfunction where | |
| import Control.Category | |
| import Data.Function (fix) | |
| import Prelude hiding (id, (.)) |
This file contains hidden or 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
| extern crate structopt; | |
| use clap::ArgGroup; | |
| use structopt::StructOpt; | |
| #[derive(Debug, StructOpt, PartialEq)] | |
| #[structopt(group(ArgGroup::with_name("confs").multiple(true)))] | |
| pub struct Command { | |
| #[structopt(long = "config", group = "confs", parse(from_str = config))] | |
| configs: Vec<Conf>, |
This file contains hidden or 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
| #![allow(incomplete_features)] | |
| #![feature(generic_associated_types)] | |
| use std::marker::PhantomData; | |
| macro_rules! do_notation { | |
| (| $ty:ty | pure $e:expr) => { | |
| <$ty>::pure($e) | |
| }; | |
| (| $ty:ty | $e:expr) => { | |
| $e |
This file contains hidden or 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 ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| module SortAsReverse where | |
| -- challenge from bindthegap.news issue 1, Nov 2020 | |
| -- | |
| -- implement reverse using sort | |
| import Data.Coerce (coerce) |
This file contains hidden or 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
| {-# OPTIONS_GHC -Wno-name-shadowing #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveFoldable #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE DeriveTraversable #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE StandaloneDeriving #-} | |
| {-# LANGUAGE TypeOperators #-} |
This file contains hidden or 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 PolyKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE Rank2Types #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE TypeInType #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE AllowAmbiguousTypes #-} |