code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
module UI.Command.Command (
Command (..),
defCmd
) where
import Data.Default
import Control.Monad.Trans (liftIO)
import UI.Command.App (App)
------------------------------------------------------------
-- Command class
--
-- | It is often sim... | kfish/ui-command | UI/Command/Command.hs | bsd-3-clause | 1,509 | 0 | 10 | 332 | 248 | 152 | 96 | 20 | 1 |
#!/usr/local/bin/runhaskell
-----------------------------------------------------------------------------
-- |
-- Program : List Buckets
-- Copyright : (c) Greg Heartsfield 2007
-- License : BSD3
--
-- List all buckets for an S3 account
-- Usage:
-- listBuckets.hs
--
-- This requires the following envi... | scsibug/hS3 | examples/listBuckets.hs | bsd-3-clause | 841 | 0 | 11 | 141 | 108 | 64 | 44 | 10 | 1 |
------------------------------------------------------------------------------
--
-- Inductive.hs -- Functional Graph Library
--
-- (c) 1999-2007 by Martin Erwig [see file COPYRIGHT]
--
------------------------------------------------------------------------------
module Data.Graph.Inductive(
module Data.Graph.I... | flowbox-public/fgl | Data/Graph/Inductive.hs | bsd-3-clause | 1,139 | 0 | 7 | 165 | 177 | 124 | 53 | 21 | 1 |
module Main (main) where
import GenUtils
import DataTypes
import Parser
import Interp
import PrintTEX
import System.Environment -- 1.3 (partain)
import Data.Char -- 1.3
--fakeArgs = "game001.txt"
--fakeArgs = "pca2.pgn"
--fakeArgs = "silly.pgn"
--fakeArgs = "small.pgn"
--fakeArgs = "sicil.pgn"
--fakeA... | sdiehl/ghc | testsuite/tests/programs/andy_cherry/Main.hs | bsd-3-clause | 6,947 | 0 | 15 | 2,345 | 1,967 | 1,044 | 923 | 136 | 11 |
module LiftToToplevel.Where1 where
import Data.Tree.DUAL.Internal
import Data.Semigroup
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NEL
unpack = undefined
foldDUALNE :: (Semigroup d, Monoid d)
=> (d -> l -> r) -- ^ Process a leaf datum along with the
... | RefactoringTools/HaRe | test/testdata/LiftToToplevel/Where1.hs | bsd-3-clause | 1,325 | 0 | 18 | 445 | 439 | 232 | 207 | 22 | 5 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE MagicHash, UnboxedTuples, DeriveDataTypeable #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Exts
-- Copyright : (c) The University of Glasgow 2002
-- License : see libraries/base/LICENSE
--
-- Maintainer : cvs... | Kyly/liquidhaskell | benchmarks/ghc-7.4.1/Exts.hs | bsd-3-clause | 4,473 | 0 | 12 | 1,038 | 759 | 451 | 308 | 58 | 2 |
module Filters where
import qualified Data.ByteString as B
import Data.Bits
import Data.Word
unhex :: [Word8] -> [Word8]
unhex [] = []
unhex (_:[]) = error "invalid input length"
unhex (x:y:xs) = (shiftL (hex2val x) 4 .|. hex2val y) : unhex xs
where hex2val x' = hex2val' (x' .|. 0x20) -- lowercase char
... | alterapraxisptyltd/serialterm | src/filters.hs | isc | 736 | 0 | 13 | 225 | 262 | 137 | 125 | 15 | 1 |
let x h = h == 3
| chreekat/vim-haskell-syntax | test/golden/nested/let-decl-badequals.hs | mit | 19 | 1 | 7 | 7 | 16 | 7 | 9 | -1 | -1 |
module ConnectFour.Protocol where
import qualified ConnectFour.Board as Board
handshake :: [String] -> Bool
handshake s = head s == "hello" && length s == 3
play :: [String] -> Bool
play s = head s == "play" && length s == 1
move :: [String] -> Bool
move s = head s == "move" && length s == 2 && r /= [... | tcoenraad/connect-four | src/ConnectFour/Protocol.hs | mit | 1,732 | 0 | 14 | 402 | 528 | 287 | 241 | 54 | 1 |
-- Generated by protobuf-simple. DO NOT EDIT!
module Types.Fixed32ListPacked where
import Control.Applicative ((<$>))
import Prelude ()
import qualified Data.ProtoBufInt as PB
newtype Fixed32ListPacked = Fixed32ListPacked
{ value :: PB.Seq PB.Word32
} deriving (PB.Show, PB.Eq, PB.Ord)
instance PB.Default Fixed32... | sru-systems/protobuf-simple | test/Types/Fixed32ListPacked.hs | mit | 1,030 | 0 | 13 | 174 | 348 | 186 | 162 | 21 | 0 |
{-# LANGUAGE NamedFieldPuns #-}
module Main (main) where
import Control.Monad.IO.Class (liftIO)
import Control.Monad.SFML (runSFML)
import qualified Control.Monad.SFML.System as S
import qualified Control.Monad.SFML.Graphics as G
import SFML.Graphics (RenderWindow)
import SFML.System.Time (Time, microseconds, asSeco... | j-rock/breakout | src/Game/Main.hs | mit | 1,603 | 0 | 12 | 367 | 501 | 265 | 236 | 46 | 2 |
{-# LANGUAGE BangPatterns #-}
module Rx.Observable.Interval where
import Tiempo (TimeInterval)
import Rx.Scheduler (Async, IScheduler, newThread, scheduleTimedRecursiveState)
import Rx.Observable.Types
interval' :: IScheduler scheduler
=> scheduler Async -> TimeInterval -> Observable Async Int
interval' sc... | roman/Haskell-Reactive-Extensions | rx-core/src/Rx/Observable/Interval.hs | mit | 625 | 0 | 16 | 112 | 163 | 86 | 77 | 15 | 1 |
{-# LANGUAGE DeriveFunctor #-}
module Data.Dani.Types (
Symbol(asText)
, symbol
, ValueF(..)
, _Symbol
, _String
, _Number
, _List
, _BoundedInteger
, _RealFloat
, _atomic
) where
import qualified Data.Text as T
import qualified Data.Scientific as N
... | danidiaz/dani-dn | library/Data/Dani/Types.hs | mit | 2,088 | 0 | 12 | 599 | 701 | 369 | 332 | 67 | 5 |
-- Closest and Smallest
-- https://www.codewars.com/kata/5868b2de442e3fb2bb000119
module Codewars.G964.Closest where
import Data.Tuple (swap)
import Data.Char (digitToInt)
import Control.Arrow ((&&&))
import Data.List (unfoldr, sortBy)
import Data.Maybe (listToMaybe)
closest :: String -> ([Int], [Int])
closest = ma... | gafiatulin/codewars | src/5 kyu/ClosestAndSmallest.hs | mit | 1,048 | 0 | 15 | 345 | 497 | 284 | 213 | 17 | 3 |
-- Problems/Problem092.hs
module Problems.Problem092 (p92) where
import Data.Char
main = print p92
p92 :: Int
p92 = length $ filter (flip elem ds567 . digitSquare) [568..9999999] ++ ds567
where ds567 = filter dsIs89 [1..567]
dsIs89 :: Int -> Bool
dsIs89 1 = False
dsIs89 89 = True
dsIs89 num = dsIs89 $ digitSqua... | Sgoettschkes/learning | haskell/ProjectEuler/src/Problems/Problem092.hs | mit | 422 | 0 | 12 | 83 | 175 | 92 | 83 | 12 | 1 |
module Demiurge.Worker where
import Antiqua.Common
import qualified Antiqua.Graphics.Tile as Antiqua
import Antiqua.Graphics.Colors
import Antiqua.Graphics.TileRenderer
import Antiqua.Data.Coordinate
import Antiqua.Data.CP437
import Demiurge.Drawing.Renderable
import Demiurge.Common
import qualified Demiurge.Tile as ... | olive/demiurge | src/Demiurge/Worker.hs | mit | 3,212 | 0 | 14 | 836 | 1,164 | 605 | 559 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
import Text.PrettyPrint
import Text.Show.Pretty (ppShow)
parensIf :: Bool -> Doc -> Doc
parensIf True = parens
parensIf False = id
type Name = String
data Expr
= Var String
| Lit Ground
| App Expr Expr
| Lam Name Expr
deriving (Eq, Show)
data Ground
= LInt Int
| LB... | riwsky/wiwinwlh | src/pretty.hs | mit | 1,462 | 11 | 17 | 398 | 819 | 404 | 415 | 53 | 2 |
{-# LANGUAGE DeriveDataTypeable,
FlexibleInstances,
GeneralizedNewtypeDeriving,
OverlappingInstances,
UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module App.Entity where
import Control.Applicative
import Data.Aeson (ToJSON(..), (.=), object)
impor... | emonkak/skype-rest-api-server | src/App/Entity.hs | mit | 13,373 | 0 | 14 | 3,471 | 2,570 | 1,346 | 1,224 | 265 | 0 |
{-
Author: Nick(Mykola) Pershyn
Language: Haskell
Program: Monte-Carlo integration with OpenCL in Haskell
-}
module KernelGen where
import Data.List(intercalate)
import FunctionTypes
genKernel :: FunctionExpression -> String
genKernel expr = {-"#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"
++ -} "__kernel "... | LinuxUser404/haskell-mcint | src/KernelGen.hs | mit | 1,919 | 0 | 19 | 576 | 684 | 358 | 326 | 36 | 2 |
{- |
Module : $Header$
Description : Basic analysis for common logic
Copyright : (c) Eugen Kuksa, Karl Luc, Uni Bremen 2010
License : GPLv2 or higher, see LICENSE.txt
Maintainer : eugenk@informatik.uni-bremen.de
Stability : experimental
Portability : portable
Basic and static analysis for common ... | nevrenato/HetsAlloy | CommonLogic/Analysis.hs | gpl-2.0 | 12,866 | 0 | 28 | 3,467 | 3,970 | 2,023 | 1,947 | 258 | 5 |
module Types where
data SmExpression = SmInt Integer
| SmFloat Double
| SmChar Char
| SmOperator Char
| SmString String
| SmList [SmExpression]
deriving (Show,Eq,Read)
instance Ord SmExpression where
(SmInt... | AlephAlpha/Samau | OldSamau/Types.hs | gpl-2.0 | 2,220 | 0 | 8 | 762 | 922 | 458 | 464 | 57 | 1 |
module Monadius (
Monadius(..) ,initialMonadius,getVariables,
GameVariables(..),
shotButton,missileButton,powerUpButton,upButton,downButton,leftButton,rightButton,selfDestructButton
) where
import Data.Array ((!), Array(), array)
import Data.Com... | keqh/Monadius_rewrite | Monadius/Monadius.hs | gpl-2.0 | 30,322 | 1 | 24 | 7,508 | 10,249 | 5,594 | 4,655 | 461 | 201 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : ./HasCASL/As.hs
Description : abstract syntax for HasCASL
Copyright : (c) Christian Maeder and Uni Bremen 2003-2005
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
ab... | gnn/Hets | HasCASL/As.hs | gpl-2.0 | 15,375 | 0 | 12 | 3,627 | 4,333 | 2,333 | 2,000 | 280 | 4 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram
-- Copyright : (c) Sven Panne 2002-2009
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- Stabi... | ducis/haAni | hs/common/Graphics/Rendering/OpenGL/GL/PixelRectangles/Histogram.hs | gpl-2.0 | 5,186 | 0 | 13 | 701 | 895 | 498 | 397 | 96 | 8 |
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Window
-- Copyright : (c) 2014 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
---------... | wavewave/hoodle-daemon | exe/Window.hs | gpl-2.0 | 3,591 | 2 | 23 | 1,222 | 1,046 | 541 | 505 | 84 | 3 |
module Utility ((//), (<$>), (<*>), date, Replacer, Filter, filterReplace, readProcessLBS, assert) where
import System.Time (getClockTime, toCalendarTime, formatCalendarTime)
import System.Locale (defaultTimeLocale)
import Data.Functor ((<$>))
import Data.List (mapAccumL)
import Data.List.Split (splitOn)
import qualifi... | taktoa/TSBannerGen | src/Utility.hs | gpl-3.0 | 3,228 | 0 | 16 | 633 | 1,207 | 641 | 566 | -1 | -1 |
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Safe #-}
#endif
module IO (
Handle, HandlePosn,
IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode),
BufferMode(NoBuffering,LineBuffering,BlockBuffering),
SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd),
stdin, std... | jwiegley/ghc-release | libraries/haskell98/IO.hs | gpl-3.0 | 2,733 | 0 | 11 | 709 | 556 | 322 | 234 | 50 | 2 |
module WildFire.WildFireModelDynamic where
import System.Random
import Data.Maybe
import Control.Monad.STM
import Control.Concurrent.STM.TVar
import qualified Data.Map as Map
import qualified PureAgentsConc as PA
type WFCellIdx = Int
type WFCellCoord = (Int, Int)
data WFCellState = Living | Burning | Dead deriving ... | thalerjonathan/phd | public/ArtIterating/code/haskell/PureAgentsConc/src/WildFire/WildFireModelDynamic.hs | gpl-3.0 | 6,776 | 0 | 16 | 2,635 | 1,956 | 1,046 | 910 | 130 | 2 |
{-# LANGUAGE TemplateHaskell, RecordWildCards #-}
-- | A font attached to its size
module Graphics.UI.Bottle.SizedFont
( SizedFont(..), font, fontSize
, render
, textHeight
, textSize
) where
import qualified Control.Lens as Lens
import Data.Vector.Vector2 (Vector2)
import Grap... | rvion/lamdu | bottlelib/Graphics/UI/Bottle/SizedFont.hs | gpl-3.0 | 973 | 0 | 9 | 178 | 255 | 144 | 111 | 23 | 1 |
module Pudding.Storage.Binary
(
) where
import Pudding.Storage.Internal.Binary
| jfulseca/Pudding | src/Pudding/Storage/Binary.hs | gpl-3.0 | 80 | 0 | 4 | 8 | 17 | 12 | 5 | 3 | 0 |
{- |
Module : Hazel.Normalize
Description : Functions for reasoning according to completion algorithm
License : GPL-3
Stability : experimental
Portability : unknown
Completion Algorithm for EL
-}
module Hazel.Completion
where
import Control.Monad.State.Lazy
import Data.List
import Data.Set (el... | hazel-el/hazel | Hazel/Completion.hs | gpl-3.0 | 3,815 | 0 | 12 | 1,115 | 1,435 | 737 | 698 | 82 | 4 |
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
-- Module ... | brendanhay/khan | khan/Khan/Model/Tag.hs | mpl-2.0 | 4,626 | 0 | 15 | 1,428 | 1,308 | 705 | 603 | 117 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/DeidentifyTemplates/Delete.hs | mpl-2.0 | 5,503 | 0 | 15 | 1,140 | 702 | 413 | 289 | 106 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
module Main (main) where
import Import
import Run
main :: IO ()
main = run
| haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2018-06-roman-gonzales-rock-solid-haskell-services-lambdaconf/hc/app/Main.hs | unlicense | 113 | 0 | 6 | 22 | 31 | 19 | 12 | 6 | 1 |
module Stuff.Pls
import Options.Applicative
stuff :: Stuff -> IO ()
stuff = putStrLn "Hai!"
main :: IO ()
main = execParser opts >>= stuff
where
opts = info (helper <*> stuff)
( fullDesc
<> progDesc "Stuff"
<> header "Hai!" )
| zackp30/programs | hs/Hai.hs | apache-2.0 | 290 | 1 | 11 | 104 | 91 | 46 | 45 | -1 | -1 |
{-# LANGUAGE GADTSyntax #-}
{-# LANGUAGE KindSignatures #-}
{-
Copyright 2019 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.a... | pranjaltale16/codeworld | codeworld-api/src/CodeWorld/App2.hs | apache-2.0 | 3,043 | 0 | 12 | 820 | 836 | 429 | 407 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import HEP.Automation.Model.Server.Type
import HEP.Automation.Model.Server.Yesod ()
import Yesod
import qualified Data.Map as M
import Data.Acid
main :: IO ()
main = do
putStrLn "model-server"
acid <- openLocalState M.empty
warpDebug 7800 (ModelServer aci... | wavewave/model-server | exe/model-server.hs | bsd-2-clause | 323 | 0 | 9 | 50 | 87 | 50 | 37 | 12 | 1 |
module Network.Minecraft.Entity (
Entity(..),
PosLook,
Position,
Look,
EID,
) where
import Network.Minecraft.GameMode
import Network.Minecraft.Inventory as Inv
type Position = (Double, Double, Double)
type Look = (Float, Float)
type Velocity = (Integer, Integer, Integer)
type PosLook = (Position, Look)
type ... | ziocroc/Minetlib | Network/Minecraft/Entity.hs | bsd-2-clause | 552 | 16 | 8 | 110 | 218 | 135 | 83 | 21 | 1 |
module Data.RDF.Query (
-- * Query functions
equalSubjects, equalPredicates, equalObjects,
subjectOf, predicateOf, objectOf, isEmpty,
rdfContainsNode, tripleContainsNode,
listSubjectsWithPredicate, listObjectsOfPredicate,
-- * RDF graph functions
isIsomorphic, expandTriples, fromEither,
-- * expansio... | LeifW/rdf4h | src/Data/RDF/Query.hs | bsd-3-clause | 5,665 | 0 | 13 | 1,048 | 1,496 | 787 | 709 | -1 | -1 |
module Ebitor.RopeUtils where
import Test.Framework
import Test.QuickCheck.Arbitrary
import qualified Data.Text as T
import Ebitor.Rope as R
pack' :: String -> Rope
pack' = R.packWithSize 5
packRope :: String -> Rope
packRope = pack'
instance Arbitrary Rope where
arbitrary = do
s <- arbitrary
... | benekastah/ebitor | test/Ebitor/RopeUtils.hs | bsd-3-clause | 438 | 0 | 10 | 108 | 129 | 70 | 59 | 17 | 1 |
{-# LANGUAGE
TypeOperators
, NoMonomorphismRestriction
#-}
-- Generate a dataset
-- Using a the bicicle model
module Attitude where
import Data.List(transpose)
import Scaling.S1
import Scaling.Time
import Linear.V1
import Linear.V2
import Linear.V3
import Data.Distributive
import Solver.RungeKutta
impor... | massudaw/mtk | filters/attitude/Attitude.hs | bsd-3-clause | 5,868 | 0 | 14 | 1,265 | 2,042 | 1,097 | 945 | 145 | 1 |
{-|
Module : Utils
Description : Some useful functions
-}
module Utils
where
import Task
import Errors
import Control.Exception
import Data.Function
import Data.List
import System.Cmd
import System.Posix.Env
import System.Exit
import System.IO
import System.Directory
-- | Compare two tuples, key ordering
kvc... | zuzia/haskell_worker | src/Utils.hs | bsd-3-clause | 1,668 | 0 | 11 | 343 | 519 | 273 | 246 | 40 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Client.ClientStateT where
import Control.Lens (makeLenses)
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as UV
import Linear (V3(..))
import Client.ClientInfoT
import Client.FrameT
impo... | ksaveljev/hake-2 | src/Client/ClientStateT.hs | bsd-3-clause | 2,760 | 0 | 9 | 1,081 | 531 | 315 | 216 | 62 | 1 |
import Codec.Pwdhash (pwdhash)
import Data.Char (isAscii, isPrint)
import System.Process (readProcess)
import Test.Framework (Test, defaultMain)
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Test.QuickCheck (Property)
import Test.QuickCheck.Arbitrary (Arbitrary(..))
import Test.QuickCheck.Gen (listO... | izuk/pwdhash | test/regression.hs | bsd-3-clause | 1,151 | 2 | 11 | 195 | 426 | 224 | 202 | 31 | 1 |
module WaveSim.Menu
(runMainMenu,
drawMainMenu) where
import Graphics.UI.GLUT as GLUT
import Control.Monad.State
import Data.IORef
import Data.Maybe
import Paths_WaveSim
import WaveSim.Graphics
import WaveSim.Widgets
import WaveSim.Types
import WaveSim.TwoD
-- DEBUG
enterThreeD :: IORef WorldState -> IO ()
ent... | jethomas/WaveSim | src/WaveSim/Menu.hs | bsd-3-clause | 3,267 | 0 | 16 | 919 | 816 | 402 | 414 | 60 | 4 |
module Sharc.Instruments.CelloPizzicato (celloPizzicato) where
import Sharc.Types
celloPizzicato :: Instr
celloPizzicato = Instr
"cello_pizzicato"
"Cello (pizzicato)"
(Legend "McGill" "1" "13")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 65.4 24 "c2"))
(Pitch 65.4 24 "c2"... | anton-k/sharc-timbre | src/Sharc/Instruments/CelloPizzicato.hs | bsd-3-clause | 85,868 | 0 | 15 | 23,903 | 34,316 | 17,823 | 16,493 | 2,915 | 1 |
{-# OPTIONS_GHC -F -pgmF inch #-}
{-# LANGUAGE RankNTypes, GADTs, KindSignatures, ScopedTypeVariables #-}
module InchPrelude where
import Prelude hiding (subtract, even, odd, gcd, lcm, (^), (^^),
fromIntegral, realToFrac, sequence,
sequence_, mapM, mapM_, (=<<), id, c... | adamgundry/inch | examples/InchPrelude.hs | bsd-3-clause | 15,705 | 10 | 16 | 6,981 | 5,739 | 3,126 | 2,613 | 295 | 3 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module Data.List.NonEmpty where
import Data.Binary
import Data.Data
import qualified Data.List as L
import Text.PrettyPrint.GenericPretty
-- | A non-empty list
data NonEmpty a = NonEmpty
{ head :: a
, tail :: [a]
} deriving (Data, Eq, Gen... | facebookarchive/lex-pass | src/Data/List/NonEmpty.hs | bsd-3-clause | 595 | 0 | 9 | 115 | 217 | 121 | 96 | 19 | 1 |
{-# LANGUAGE TupleSections, TypeFamilies, FlexibleContexts, RankNTypes,
PackageImports #-}
module Data.Pipe.Core (
PipeClass(..), PipeChoice(..), (=@=), runPipe_, convert,
Pipe(..), finally, bracket ) where
import Control.Applicative
import Control.Monad
import Control.Exception.Lifted (onException)
import Control... | YoshikuniJujo/simple-pipe | src/Data/Pipe/Core.hs | bsd-3-clause | 7,779 | 28 | 14 | 2,056 | 4,790 | 2,379 | 2,411 | 176 | 1 |
module Paths ( hseDirStructure
, cabalConfigLocation
, dotDirName
, constructDotDirName
, insidePathVar
, cachedCabalInstallPath
) where
import Data.List (intercalate)
import Distribution.Version (Version)
import System.Directory (getAppUser... | Paczesiowa/hsenv | src/Paths.hs | bsd-3-clause | 3,159 | 0 | 14 | 829 | 582 | 307 | 275 | 63 | 3 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
-- | Runners in various modes.
module Pos.Launcher.Runner
( -- * High level runners
runRealMode
-- * Exported for custom usage in CLI utils
, runServer
, elimRealMode
... | input-output-hk/pos-haskell-prototype | lib/src/Pos/Launcher/Runner.hs | mit | 8,232 | 0 | 17 | 2,295 | 1,523 | 855 | 668 | -1 | -1 |
module A where
import B
main = 'a' +++ 3
| roberth/uu-helium | test/typeerrors/Strategies/A.hs | gpl-3.0 | 43 | 0 | 5 | 12 | 16 | 10 | 6 | 3 | 1 |
{-# LANGUAGE CPP #-}
{-|
Module : Idris.CmdOptions
Description : A parser for the CmdOptions for the Idris executable.
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE Arrows #-}
module Idris.CmdOptions
(
module Idris.CmdOptions
, opt
, getClient, getPkg, getPkgCheck, getPkgClean, ... | jmitchell/Idris-dev | src/Idris/CmdOptions.hs | bsd-3-clause | 15,359 | 1 | 109 | 4,835 | 3,571 | 1,746 | 1,825 | 220 | 2 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1998
\section[TypeRep]{Type - friends' interface}
Note [The Type-related module hierarchy]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Class
TyCon imports Class
TypeRep
TysPrim imports TypeRep ( including mkTyConTy )
Kind... | acowley/ghc | compiler/types/TypeRep.hs | bsd-3-clause | 33,171 | 0 | 17 | 8,969 | 5,257 | 2,828 | 2,429 | 367 | 4 |
{-# OPTIONS -Wall #-}
-----------------------------------------------------------------------------
-- |
-- Module : Test.Environment
-- Copyright : (c) 2008 Duncan Coutts, Benedikt Huber
-- License : BSD-style
-- Maintainer : benedikt.huber@gmail.com
-- Portability : portable
--
-- This module provide... | jthornber/language-c-ejt | test-framework/Language/C/Test/Environment.hs | bsd-3-clause | 5,373 | 0 | 18 | 1,197 | 1,279 | 694 | 585 | 89 | 3 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
-}
{-# LANGUAGE CPP #-}
module IfaceSyn (
module IfaceType,
IfaceDecl(..), IfaceFamTyConFlav(..), IfaceClassOp(..), IfaceAT(..),
IfaceConDecl(..), IfaceConDecls(..), IfaceEqSpec,
IfaceExpr(... | green-haskell/ghc | compiler/iface/IfaceSyn.hs | bsd-3-clause | 70,422 | 76 | 27 | 23,566 | 17,337 | 8,624 | 8,713 | 1,343 | 11 |
-- | Types used separate to GHCi vanilla.
module GhciTypes where
import Data.Time
import GHC
import Intero.Compat
import Outputable
-- | Info about a module. This information is generated every time a
-- module is loaded.
data ModInfo =
ModInfo {modinfoSummary :: !ModSummary
-- ^ Summary generated by GH... | chrisdone/intero | src/GhciTypes.hs | bsd-3-clause | 2,371 | 0 | 12 | 731 | 305 | 173 | 132 | 48 | 0 |
{-----------------------------------------------------------------------------
A LIBRARY OF MEMOIZATION COMBINATORS
15th September 1999
Byron Cook
OGI
This Hugs module implements several flavors of memoization functions,
as desc... | kaoskorobase/mescaline | resources/hugs/packages/hugsbase/Hugs/Memo.hs | gpl-3.0 | 4,725 | 6 | 20 | 1,399 | 1,410 | 743 | 667 | -1 | -1 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude
, BangPatterns
, RankNTypes
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- M... | urbanslug/ghc | libraries/base/GHC/IO.hs | bsd-3-clause | 20,246 | 67 | 15 | 4,282 | 1,812 | 1,046 | 766 | 125 | 3 |
module Foo.Bar where
baz = 6
| RefactoringTools/HaRe | test/testdata/cabal/cabal4/src/Foo/Bar.hs | bsd-3-clause | 30 | 0 | 4 | 7 | 11 | 7 | 4 | 2 | 1 |
{-# LANGUAGE DeriveTraversable #-}
module T9069 where
import Data.Foldable
import Data.Traversable
data Trivial a = Trivial a
deriving (Functor,Foldable,Traversable) | olsner/ghc | testsuite/tests/deriving/should_compile/T9069.hs | bsd-3-clause | 171 | 0 | 6 | 24 | 40 | 24 | 16 | 6 | 0 |
-- Problem 7
--Listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
--What is the 10001st prime number?
import Primes
euler7 = nthPrime 10001
nthPrime :: Int -> Int
nthPrime n = nthPrime' 0 n
nthPrime' :: Int -> Int -> Int
nthPrime' cur nth
| nth == 0 = cur
| ot... | RossMeikleham/Project-Euler-Haskell | 07.hs | mit | 368 | 0 | 8 | 87 | 98 | 50 | 48 | 8 | 1 |
-- | The Plan provides a notation to describe the simulated network
-- traffic in terms of Patterns and Activities.
module SyntheticWeb.Plan
( Plan (..)
, Bytes
, Weight (..)
, Pattern (..)
, Activity (..)
, Duration (..)
, Rate (..)
, Download (..)
... | kosmoskatten/synthetic-web | src/SyntheticWeb/Plan.hs | mit | 572 | 0 | 5 | 183 | 116 | 81 | 35 | 19 | 0 |
{-# LANGUAGE ConstrainedClassMethods #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveGeneric #-}
module Yesod.Auth.Simp... | prasmussen/glot-www | Yesod/Auth/Simple.hs | mit | 19,722 | 0 | 23 | 4,506 | 5,142 | 2,508 | 2,634 | 437 | 3 |
module Grammar.Greek.Morph.ShouldElide.Round where
import Control.Lens (over)
import Data.Either.Validation
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Grammar.Common
import Grammar.Greek.Morph.Aspirate
import Grammar.Greek.Morph.Forms.Eliding
import Grammar.Greek.Morph.Types
import Gra... | ancientlanguage/haskell-analysis | greek-morph/src/Grammar/Greek/Morph/ShouldElide/Round.hs | mit | 1,910 | 0 | 13 | 330 | 630 | 335 | 295 | -1 | -1 |
module Val where
import Data.List
import Language
import Parser
import Heap
fst3 (a, b, c) = a
snd3 (a, b, c) = b
thrd3 (a, b, c) = c
data Point4 = Top4 --All elements and entire spine defined
| SpineStrict --Entire Spine defined, but some elements may be _|_
| Inf --Spine e... | jmct/IterativeCompiler | frontend/Val.hs | mit | 1,855 | 0 | 13 | 607 | 667 | 363 | 304 | 39 | 5 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ExistentialQuantification #-}
-- |
-- Module : System.Wlog.Parser
-- Copyright : (c) Serokell, 2016
-- License : GPL-3 (see the file LICENSE)
-- Maintainer : Serokell <hi@serokell.io>
-- Stability : experimental
-- Portability : POSIX, GHC
--
-- Par... | serokell/log-warper | src/System/Wlog/Launcher.hs | mit | 8,527 | 0 | 23 | 2,167 | 1,276 | 683 | 593 | -1 | -1 |
-- code related to Loday's "Arithmetree"
module Loday where
import Data.List
import Bijections
import Catalan
import Tamari
import Permutohedra
import qualified Lambda as Lam
lsumv :: Tree -> Tree -> [Tree]
rsumv :: Tree -> Tree -> [Tree]
sumv :: Tree -> Tree -> [Tree]
lsumv x L = [x]
lsumv (B xL xR) y = [B xL z |... | noamz/linlam-gos | src/Loday.hs | mit | 2,265 | 0 | 18 | 526 | 972 | 496 | 476 | 51 | 1 |
module ProjectEuler.Problem77
( problem
) where
import Petbox
import Math.NumberTheory.Primes.Testing (isPrime)
import ProjectEuler.Types
problem :: Problem
problem = pureProblem 77 Solved result
numParts :: Int -> Int -> [ [Int] ]
numParts m n
| n > m = []
| n == m = [ [n] | isPrime (fromIntegral m)]
... | Javran/Project-Euler | src/ProjectEuler/Problem77.hs | mit | 617 | 0 | 12 | 152 | 272 | 142 | 130 | 20 | 1 |
{-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleInstances #-}
module Galua.Debugger.PrettySource
( Line, lexChunk, omittedLine
, NameId(..), LocatedExprName
, lineToJSON
) where
import AlexTools(Lexeme(..))
import Language.Lua.Annotated.Lexer
( llexNamedWithWhiteSpace,SourcePos(..),Sour... | GaloisInc/galua | galua-dbg/src/Galua/Debugger/PrettySource.hs | mit | 9,648 | 0 | 18 | 3,216 | 2,841 | 1,512 | 1,329 | 230 | 64 |
module Game.ChutesAndLadders.Player where
import Data.Function (on)
import Data.List ((\\), groupBy, sortBy)
import Data.Ord (comparing)
import Text.PrettyPrint.Boxes
import Game.ChutesAndLadders.Cli (printPaddingN, promptNumber, promptPlayerName)
import Game.ChutesAndLadders.Types
import Game.ChutesAndLadders.Util
... | rjregenold/chutes-and-ladders | Game/ChutesAndLadders/Player.hs | mit | 1,832 | 0 | 13 | 407 | 721 | 379 | 342 | 45 | 1 |
module GHCJS.DOM.Worker (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/Worker.hs | mit | 36 | 0 | 3 | 7 | 10 | 7 | 3 | 1 | 0 |
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= skinny = "You're underweight, you emo, you!"
| bmi <= normal = "You're supposedly normal. Pffft, I bet you're ugly!"
| bmi <= fat = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
... | skywind3000/language | haskell/bmi.hs | mit | 572 | 0 | 8 | 176 | 188 | 98 | 90 | 13 | 1 |
module Import.NoFoundation
( module Import
) where
import ClassyPrelude.Yesod as Import hiding (languages)
import Model as Import
import Settings as Import
import Settings.StaticFiles as Import
import Yesod.Auth as Import
import Yesod.Core.Types as Import (logger... | prasmussen/glot-www | Import/NoFoundation.hs | mit | 364 | 0 | 5 | 95 | 70 | 50 | 20 | 9 | 0 |
{-# LANGUAGE TemplateHaskell #-}
module Jumpie.GameState where
import Jumpie.GameObject
import Jumpie.Player
import ClassyPrelude
import Jumpie.Types
import Jumpie.Platforms
import Control.Lens.TH
import Control.Lens((^.))
import Control.Lens.Getter(to,Getter)
import Wrench.Time
data GameState = G... | pmiddend/jumpie | lib/Jumpie/GameState.hs | gpl-3.0 | 814 | 0 | 16 | 133 | 227 | 134 | 93 | 23 | 1 |
module Lamdu.Sugar.Convert.TaggedList where
import Lamdu.Sugar.Types.Parts
import Lamdu.Sugar.Types.Tag
import Lamdu.Prelude
convert :: Applicative o => i (TagChoice name o) -> [TaggedItem name i o a] -> TaggedList name i o a
convert addFirst items =
TaggedList
{ _tlAddFirst = addFirst
, _tlItems =
... | lamdu/lamdu | src/Lamdu/Sugar/Convert/TaggedList.hs | gpl-3.0 | 604 | 0 | 16 | 198 | 161 | 91 | 70 | 16 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Dsgen.TestCards where
import Control.Monad(liftM)
import Control.Monad.Error
import Data.ConfigFile
import Test.HUnit
import Test.QuickCheck
import Test.QuickCheck.All
import Dsgen.Cards
import Dsgen.TestHelpers
{- Test definitions -}
amountReadTest = TestCase $ do
asse... | pshendry/dsgen | testsuite/Dsgen/TestCards.hs | gpl-3.0 | 4,439 | 0 | 18 | 1,453 | 917 | 517 | 400 | 117 | 1 |
module Main(main) where
import Data.Bits(bit,testBit)
import Data.Char(chr,ord)
import Data.List(splitAt)
import System.Environment(getArgs)
import Interp(apply,arity)
import ParseBodies(parseBodies)
import ParseSigs(parseSigs)
import Tokenizer(tokenize)
main :: IO ()
main = do
stdinText <- getContents
inte... | qpliu/esolang | 01_/hs/interp/hi01_.hs | gpl-3.0 | 1,787 | 0 | 15 | 358 | 805 | 412 | 393 | 46 | 2 |
{-# LANGUAGE
Rank2Types
, OverloadedStrings
, DeriveFunctor
, ScopedTypeVariables
, TemplateHaskell
#-}
module Rasa.Internal.Range
( Coord
, Coord'(..)
, overRow
, overCol
, overBoth
, coordRow
, coordCol
, Offset(..)
, asCoord
, clampCoord
, clampRange
, Range(..)
, CrdRange
, ra... | ChrisPenner/rasa | rasa/src/Rasa/Internal/Range.hs | gpl-3.0 | 8,165 | 0 | 13 | 1,962 | 2,698 | 1,417 | 1,281 | -1 | -1 |
module GameOver where
import DataTypes
import Graphics.Gloss
import Graphics.Gloss.Interface.Pure.Game
-- | Update the gameover screen.
updateGameOver :: Float -> AsteroidsGame -> AsteroidsGame
updateGameOver seconds game = game
-- | Handle the key events on the gameover screen.
handleGameOverKeys :: Event -> Asteroi... | kareem2048/Asteroids | GameOver.hs | gpl-3.0 | 801 | 0 | 13 | 126 | 236 | 129 | 107 | 16 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-emr/gen/Network/AWS/EMR/ListBootstrapActions.hs | mpl-2.0 | 4,688 | 0 | 12 | 1,015 | 656 | 385 | 271 | 74 | 1 |
module Codewars.Lambda4fun.ParseHtmlColor where
-- module A where
import Codewars.Lambda4fun.ParseHtmlColor.PresetColors (presetColors)
import Data.Char (toLower, digitToInt)
import Data.List (insert)
import Data.Map.Strict (Map, fromList, (!))
parseHtmlColor :: String -> Map Char Int
parseHtmlColor ('#':t) = fromLis... | ice1000/OI-codes | codewars/1-100/arse-html-slash-css-colors.hs | agpl-3.0 | 690 | 0 | 9 | 119 | 306 | 175 | 131 | 12 | 1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE GADTs #-}
-- For later examples
{-# LANGUAGE TypeOperators, DataKinds, FlexibleContexts #-}
-- ** Freer Monad and Extensible interpreters
module Tutorial2_Orig where
import OpenUnion52
-- Review our general way to give meaning to effectful computations
data ... | haroldcarr/learn-haskell-coq-ml-etc | haskell/conference/2017-09-cufp-effects/src/Tutorial2_Orig.hs | unlicense | 3,966 | 0 | 10 | 1,008 | 68 | 41 | 27 | 8 | 0 |
module binDec where
binDec :: [Int] -> Int
binDec (x:[]) = x
binDec (x:y) = x + binDec y * 2 | tonilopezmr/Learning-Haskell | Exercises/2/Exercise_2.hs | apache-2.0 | 96 | 11 | 7 | 24 | 61 | 33 | 28 | -1 | -1 |
-----------------------------------------------------------------------------
-- Copyright 2019, Ideas project team. This file is distributed under the
-- terms of the Apache License 2.0. For more information, see the files
-- "LICENSE.txt" and "NOTICE.txt", which are included in the distribution.
-----------------... | ideas-edu/ideas | src/Ideas/Text/OpenMath/Object.hs | apache-2.0 | 4,566 | 0 | 19 | 1,655 | 1,263 | 617 | 646 | 101 | 13 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Text -- Using Text to test the integer-simple flag handling with stack
import Lib1
import Lib2
main :: IO ()
main = do
printGreeting $ hello $ unpack "world"
| prezi/gradle-haskell-plugin | src/test-projects/test1-with-text/app/src/main/haskell/Main.hs | apache-2.0 | 209 | 0 | 8 | 38 | 43 | 23 | 20 | 7 | 1 |
chk t d =
let a = foldl (\ a (s:f:_) -> a + (f-s) ) 0 d
in
if a >= t
then "OK"
else show (t-a)
ans ([0]:_) = []
ans ([t]:[n]:x) =
let d = take n x
r = chk t d
y = drop n x
in
r:ans y
main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = an... | a143753/AOJ | 0238.hs | apache-2.0 | 343 | 0 | 14 | 131 | 240 | 121 | 119 | 16 | 2 |
{-# LANGUAGE DefaultSignatures #-}
{- |
Module : Data.Mono
Description : Monomorphic functor, foldable, traversable and monad.
Copyright : (c) Paweł Nowak
License : Apache v2.0
Maintainer : pawel834@gmail.com
Stability : experimental
Portability : portable
It turns out that Control.Lens does exac... | pawel-n/haskell-lib | Data/Mono.hs | apache-2.0 | 2,814 | 0 | 14 | 779 | 835 | 432 | 403 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module Text.Megaparsec.ExprSpec (spec) where
import Data.Monoid ((<>))
import Test.Hspec
import Test.Hspec.Megaparsec
import Test.Hspec.Megaparsec.AdHoc
import Test.QuickCheck
import Text.Megaparsec
import Text.Megap... | recursion-ninja/megaparsec | tests/Text/Megaparsec/ExprSpec.hs | bsd-2-clause | 5,030 | 0 | 18 | 1,346 | 1,839 | 954 | 885 | 122 | 2 |
-- The Timber compiler <timber-lang.org>
--
-- Copyright 2008-2009 Johan Nordlander <nordland@csee.ltu.se>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
--
-- 1. Redistributions of sour... | UBMLtonGroup/timberc | src/Syntax2Core.hs | bsd-3-clause | 19,496 | 0 | 15 | 8,396 | 5,869 | 2,914 | 2,955 | 241 | 4 |
{-# LANGUAGE TupleSections #-}
module Magic.BoosterPack
( genPack
) where
import Magic.Card
import Prelude
import System.Random
import System.Random.Shuffle
import Control.Applicative ((<$>))
import Control.Monad
genPack :: [Card] -> IO [RealCard]
genPack cards = do
isMythic <- (==1) <$> getStdRandom (random... | mkut/libmtg | Magic/BoosterPack.hs | bsd-3-clause | 1,156 | 0 | 12 | 272 | 448 | 226 | 222 | 25 | 4 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANG... | haskell-distributed/distributed-process-execution | src/Control/Distributed/Process/Execution/Exchange/Broadcast.hs | bsd-3-clause | 11,854 | 0 | 20 | 2,900 | 2,249 | 1,211 | 1,038 | 225 | 5 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module Test.ZM.ADT.StoreProtocol.Ke83859e52e9a (StoreProtocol(..)) where
import qualified Prelude(Eq,Ord,Show)
import qualified GHC.Generics
import qualified Flat
import qualified Data.Model
import qualified Test.ZM.ADT.SHAKE128_48.K9f214799149b
data Stor... | tittoassini/typed | test/Test/ZM/ADT/StoreProtocol/Ke83859e52e9a.hs | bsd-3-clause | 672 | 0 | 9 | 111 | 168 | 105 | 63 | 13 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Network.XmlRpc.Wai (waiXmlRpcServer) where
import Control.Monad.IO.Class
import Control.Monad.Error
import Network.HTTP.Types
import qualified Network.Wai as W
import Data.Conduit (($$), ($=), (=$))
import qualified Data.Conduit as C
import qualified Data.Conduit.Binary as C... | akiochiai/haxr-wai | Network/XmlRpc/Wai.hs | bsd-3-clause | 2,000 | 0 | 17 | 588 | 552 | 303 | 249 | 38 | 2 |
{-# LANGUAGE FlexibleContexts, FlexibleInstances, GADTs #-}
-- | The @esqueleto@ EDSL (embedded domain specific language).
-- This module replaces @Database.Persist@, so instead of
-- importing that module you should just import this one:
--
-- @
-- -- For a module using just esqueleto.
-- import Database.Esqueleto
-- ... | krisajenkins/esqueleto | src/Database/Esqueleto.hs | bsd-3-clause | 13,004 | 0 | 11 | 2,601 | 931 | 766 | 165 | 73 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.NV.TextureShader2
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portable
-... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/TextureShader2.hs | bsd-3-clause | 661 | 0 | 4 | 78 | 37 | 31 | 6 | 3 | 0 |
module Main where
import Haste
import Haste.Concurrent
main = concurrent $ do
ctr <- newEmptyMVar
forkIO $ updater ctr
counter ctr 0
-- | This thread counts.
counter :: MVar Int -> Int -> CIO ()
counter ctr startval =
go startval
where
go n = do
putMVar ctr n
wait 1000
go (n+1)
-- |... | joelburget/haste-compiler | examples/concurrency/counter.hs | bsd-3-clause | 516 | 0 | 11 | 156 | 193 | 90 | 103 | 21 | 1 |
module Database.Hitcask.Hint where
import Database.Hitcask.Types
import Database.Hitcask.Logs
import Database.Hitcask.Put
import qualified Data.ByteString.Char8 as B
import Data.Serialize.Put
import System.IO(hFlush, hClose)
import System.FilePath
writeHint :: HintFile -> Key -> ValueLocation -> IO ()
writeHint (LogFi... | tcrayford/hitcask | Database/Hitcask/Hint.hs | bsd-3-clause | 1,125 | 0 | 11 | 199 | 387 | 196 | 191 | 35 | 1 |
{-# LANGUAGE CPP #-}
module Gre where
import Control.Monad
import Data.Binary.Put
import Data.Bits
import qualified Data.ByteString.Lazy as B
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Perm
import Util
import Packet
import Lexer
#ifdef HRWS_TEST
import Debug.Trace
import Test.QuickChec... | karknu/rws | src/Gre.hs | bsd-3-clause | 2,773 | 0 | 15 | 579 | 910 | 464 | 446 | 38 | 1 |
module StringCalculator
( implementations
, calculate
) where
import qualified StringCalculator.AST as AST
implementations :: [(String, String -> Either String Rational)]
implementations = [("AST", AST.calculate)]
calculate = AST.calculate
| danstiner/infix-string-calculator | src/StringCalculator.hs | bsd-3-clause | 255 | 0 | 8 | 43 | 66 | 41 | 25 | 7 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.