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
#include <dirent.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int findUp(char* cwd, const char* needle, unsigned char typ); | |
void findDown(char* cwd, const char* needle, unsigned char typ, char* out); |
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 BangPatterns #-} | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module Main where | |
import Data.Functor.Identity | |
import Data.Monoid |
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 DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeFamilyDependencies #-} | |
{-# LANGUAGE TypeInType #-} |
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 RankNTypes #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
-- | Error handling | |
-- | |
-- Intended for qualified import | |
-- | |
-- > import Ouroboros.Storage.Util.ErrorHandling (ErrorHandling(..)) | |
-- > import qualified Ouroboros.Storage.Util.ErrorHandling as EH |
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
-- | Convert 'Double' to fixed precision | |
-- | |
-- For precision 'E1', we have | |
-- | |
-- > 1.000 1.010 1.040 1.049 1.050 1.051 1.090 1.100 | |
-- > floor | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.1 | |
-- > round | 1.0 1.0 1.0 1.0 1.0(*) 1.1 1.1 1.1 | |
-- > ceiling | 1.0 1.1 1.1 1.1 1.1 1.1 1.1 1.1 | |
-- | |
-- (*): See <https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules> |
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 FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module Main where | |
import Data.IORef | |
import Data.TreeDiff |
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 FlexibleContexts #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# OPTIONS_GHC -Wall #-} | |
import Control.Monad.Reader | |
import Data.Coerce | |
import Test.QuickCheck.Gen | |
import Test.QuickCheck.Monadic |
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
-- | Recover tree structure from linearized form | |
-- | |
-- Suppose we have a list of strings | |
-- | |
-- > A | |
-- > B | |
-- > C | |
-- > D | |
-- > E | |
-- > F |
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 RecordWildCards #-} | |
module SoundSeries.Util.SoupParser ( | |
SoupParser | |
, parseSoup | |
-- * Combinators | |
, satisfy | |
, anyToken | |
, skipUntil | |
, lookupAttr |
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 ConstraintKinds #-} | |
{-# OPTIONS_GHC -Wno-redundant-constraints #-} | |
module edundantConstraints ( | |
keepRedundantConstraint | |
) where | |
-- | Can be used to silence individual "redundant constraint" warnings | |
-- | |
-- > foo :: ConstraintUsefulForDebugging => ... |