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
(defun org-read-add-default-time | |
(&optional with-time to-time from-string prompt | |
default-time default-input inactive) | |
"Filters the inputs to `org-read-date', setting the current time | |
as the default input if one was not already specified." | |
(let ((new-default (or default-input (format-time-string "%H:%M")))) | |
(list with-time to-time from-string prompt | |
default-time new-default inactive))) | |
(define-advice org-read-date (:filter-args (args) default-current-time) |
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
(defface haskell-big-keyword-face | |
'((t (:inherit haskell-keyword-face :weight bold :height 2.0))) | |
"BIG keywords.") | |
(defvar haskell-font-lock-big-data-keywords | |
'(("^data\\>" 0 'font-lock-big-keyword-face t))) | |
(define-minor-mode haskell-big-data-mode | |
"Minor mode for working with BIG data in Haskell. Adds a font | |
lock keyword for rendering 'data' at twice the normal font size." | |
:group haskell-big-data-mode |
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
list :: [Task Text] | |
list = to do | |
(□) "milk" | |
(□) "eggs" | |
(✓) "orange juice" | |
data Task a = Done a | Todo a deriving (Show) | |
to = execWriter |
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
{ | |
"title": "Cabal file", | |
"type": "object", | |
"properties": { | |
"license-files": { | |
"description": "One or more files containing the precise copyright license for the package.", | |
"items": { | |
"type": "string" | |
}, | |
"type": "array" |
This file has been truncated, but you can view the full file.
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 DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, | |
CPP #-} | |
#if __GLASGOW_HASKELL__ >= 708 | |
{-# LANGUAGE RoleAnnotations #-} | |
#endif | |
{-# OPTIONS_HADDOCK hide #-} | |
----------------------------------------------------------------------------- | |
-- | | |
-- Module : Data.Array.IO.Internal |
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 Unsafe #-} | |
{-# LANGUAGE CPP | |
, NoImplicitPrelude | |
, ScopedTypeVariables | |
, BangPatterns | |
#-} | |
module GHC.Event.Control | |
module(GHC.Event.Control | |
(-- * Managing the IO manager |
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
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }: | |
let | |
inherit (nixpkgs) pkgs; | |
# Build a default.nix file from our .cabal file: | |
here = ./.; | |
project = pkgs.stdenv.mkDerivation ({ | |
name = "default.nix"; |
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
newtype RState s a = RState (s -> (a, s)) | |
-- takes initial state s and outputs both a result and a new state | |
runRState :: RState s a -> s -> (a, s) | |
runRState (RState f) start = f start | |
instance Monad (RState s) where | |
return x = RState $ \ s -> (x, s) | |
RState step1 >>= step2 = RState $ \ start -> | |
let (resultA, final) = step1 intermediate |
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
#! /usr/bin/env runhaskell | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.Functor ((<$)) | |
import System.Directory (removeFile) | |
import System.Environment (getArgs) | |
import System.Process (runCommand) | |
import Text.Printf (printf) |
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 TemplateHaskell #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
import qualified Data.Graph.Inductive as Graph | |
import Data.Graph.Inductive (Gr, match, matchAny) | |
import Data.String.Interpolation (str) | |
complex :: Gr () () | |
complex = Graph.mkGraph nodes edges | |
where nodes = [(x, ()) | x <- [1..10]] |