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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
------------------------------------------------------------------------
-- |
-- Module : ALife.Creatur.Wain.UIVector.Cluster.GeneratePopulation
-- Copyright : (c) Amy de Buitléir 2012-2016
-- License : BSD-style
-- Maintainer : amy@nualeargais.ie
-- Stability : experimental
-- Portability : portabl... | mhwombat/exp-uivector-cluster-wains | src/ALife/Creatur/Wain/UIVector/Cluster/GeneratePopulation.hs | bsd-3-clause | 2,203 | 0 | 13 | 322 | 528 | 286 | 242 | 44 | 1 |
{-# LANGUAGE QuasiQuotes #-}
module Cauterize.GHC7.Generate.GenStack
( generateOutput
) where
import Cauterize.GHC7.Options
import Cauterize.GHC7.Generate.Utils
import qualified Cauterize.Specification as Spec
import System.FilePath.Posix
import Data.String.Interpolate.Util
import Data.String.Interpolate... | cauterize-tools/caut-ghc7-ref | src/Cauterize/GHC7/Generate/GenStack.hs | bsd-3-clause | 1,274 | 0 | 10 | 210 | 157 | 91 | 66 | 18 | 1 |
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Singletons.BoxUnBox where
import Data.Singletons.TH
import Data.Singletons.SuppressUnusedWarnings
$(singletons [d|
data Box a = FBox a
unBox :: Box a -> a
unBox (FBox a) = a
|])
| int-index/singletons | tests/compile-and-dump/Singletons/BoxUnBox.hs | bsd-3-clause | 240 | 0 | 7 | 41 | 33 | 21 | 12 | -1 | -1 |
-- © 2001, 2002 Peter Thiemann
module Main where
import WASH.CGI.CGI hiding (head, map, span, div)
main =
run $
standardQuery "Upload File" $
do text "Enter file to upload "
fileH <- checkedFileInputField refuseUnnamed empty
submit fileH display (fieldVALUE "UPLOAD")
refuseUnnamed mf =
do FileRefe... | nh2/WashNGo | Examples/old/Upload.hs | bsd-3-clause | 667 | 0 | 15 | 141 | 217 | 105 | 112 | 18 | 2 |
module IptAdmin.Config where
import Control.Monad.Error
import Data.ConfigFile
import IptAdmin.Types
import System.FilePath.Posix
cONFpATHd :: String
cONFpATHd = "/etc/iptadmin"
cONFIGURATIONf :: String
cONFIGURATIONf = "iptadmin.conf"
getConfig :: ErrorT String IO IptAdminConfig
getConfig = do
configE <- lift... | etarasov/iptadmin | src/IptAdmin/Config.hs | bsd-3-clause | 1,482 | 0 | 17 | 626 | 314 | 153 | 161 | 34 | 3 |
{-# LANGUAGE CPP, FlexibleInstances, OverloadedStrings, Rank2Types #-}
#ifdef GENERICS
{-# LANGUAGE DefaultSignatures, TypeOperators, KindSignatures, FlexibleContexts,
MultiParamTypeClasses, UndecidableInstances, ScopedTypeVariables #-}
#endif
module Data.Csv.Conversion
(
-- * Type conversion
... | sjoerdvisscher/cassava | Data/Csv/Conversion.hs | bsd-3-clause | 24,266 | 0 | 20 | 6,582 | 6,582 | 3,522 | 3,060 | 414 | 2 |
{-# OPTIONS_GHC -F -pgmF htfpp #-}
module Ebitor.Rope.CursorTest (htf_thisModulesTests) where
import Data.List (intercalate)
import Data.Maybe (fromJust)
import Test.Framework
import Ebitor.Rope (Rope)
import Ebitor.Rope.Cursor
import Ebitor.RopeUtils
import qualified Ebitor.Rope as R
madWorld = "it's a mad mad mad... | benekastah/ebitor | test/Ebitor/Rope/CursorTest.hs | bsd-3-clause | 2,415 | 0 | 11 | 570 | 648 | 371 | 277 | 57 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Themes
( InternalTheme(..)
, defaultTheme
, internalThemes
, lookupTheme
, themeDocs
-- * Attribute names
, timeAttr
, channelHeaderAttr
, channelListHeaderAttr
, currentChannelNameAttr
, unreadChannelAttr
, mentionsChannelAttr
, urlAttr
, codeAttr... | aisamanra/matterhorn | src/Themes.hs | bsd-3-clause | 17,282 | 0 | 15 | 5,079 | 3,205 | 1,927 | 1,278 | 412 | 2 |
module Opaleye.Internal.NEList where
data NEList a = NEList a [a] deriving Show
singleton :: a -> NEList a
singleton = flip NEList []
toList :: NEList a -> [a]
toList (NEList a as) = a:as
neCat :: NEList a -> NEList a -> NEList a
neCat (NEList a as) bs = NEList a (as ++ toList bs)
instance Functor NEList where
f... | k0001/haskell-opaleye | Opaleye/Internal/NEList.hs | bsd-3-clause | 511 | 0 | 12 | 120 | 262 | 132 | 130 | 14 | 1 |
import Control.Monad
import Codec.Compression.GZip
import qualified Data.ByteString.Char8 as S
import qualified Data.ByteString.Lazy as L
import System.FilePath
import System.FilePath.Find
import System.FilePath.Glob
import System.FilePath.Manip
import Text.Regex.Posix ((=~))
-- Get a list of all symlinks.
getDangl... | bos/filemanip | examples/Simple.hs | bsd-3-clause | 2,319 | 0 | 11 | 536 | 692 | 375 | 317 | 38 | 3 |
module Avg where
{-@ measure sumD :: [Double] -> Double
sumD([]) = 0.0
sumD(x:xs) = x + (sumD xs)
@-}
{-@ measure lenD :: [Double] -> Double
lenD([]) = 0.0
lenD(x:xs) = (1.0) + (lenD xs)
@-}
{-@ expression Avg Xs = ((sumD Xs) / (lenD Xs)) @-}
{-@ meansD :: xs:{v:[Double] | ((lenD v) > 0.0)}
... | ssaavedra/liquidhaskell | tests/pos/Avg.hs | bsd-3-clause | 673 | 0 | 7 | 173 | 128 | 70 | 58 | 9 | 1 |
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-}
{-# OPTIONS_GHC -fcontext-stack42 #-}
module Games.Chaos2010.Database.Database_constraints where
import Games.Chaos2010.Database.Fields
import Database.HaskellDB.DBLayout
type Database_constraints =
Record
(HCons (LVPair Constraint_name (Expr String))... | JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Database_constraints.hs | bsd-3-clause | 487 | 0 | 13 | 65 | 92 | 52 | 40 | 11 | 1 |
module MapDeclM where
import Recursive
import IdM
{-+
A class to apply a monadic function to all declarations in a
structure. The type of the structure is #s#, the type of the declarations
is #d#. The functional dependency ensures that we can determine the
type of declarations from the type of the structure.
-}
cl... | forste/haReFork | tools/base/transforms/MapDeclM.hs | bsd-3-clause | 686 | 0 | 11 | 145 | 150 | 78 | 72 | -1 | -1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
-- |
-- #name_types#
-- GHC uses several kinds of name internally:
--
-- * 'OccName.OccName': see "OccName#name_types"
--
-- * 'RdrName.RdrName' is the type of names that come di... | green-haskell/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | 36,400 | 0 | 16 | 10,219 | 7,365 | 3,920 | 3,445 | 472 | 5 |
module Board
( Board (..)
, mkBoard
, isEmptyCell
, isValidUnit
, lockUnit
, clearFullRows
) where
import Control.Arrow ((&&&))
import Data.Ix (inRange,range)
import Data.List (foldl')
import Data.Set (Set(..))
import qualified Data.Set as Set
import Cell
import Unit
import Types
data Board = Board { c... | msakai/icfpc2015 | src/Board.hs | bsd-3-clause | 1,995 | 0 | 17 | 545 | 854 | 476 | 378 | 49 | 1 |
{-# LANGUAGE DoAndIfThenElse #-}
module Term(Term(..), TermClass(..), Substitution(..), parse, act, makeUniqueVars, betaReduction) where
import Text.Parsec hiding (parse)
import qualified Text.Parsec as Parsec
import Control.Applicative hiding ((<|>))
import Control.Monad
import Data.List
import VarEnvironment
data ... | projedi/type-inference-rank2 | src/Term.hs | bsd-3-clause | 4,308 | 0 | 17 | 1,124 | 1,794 | 908 | 886 | 115 | 5 |
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
module FreeAgentSpec (main, spec) where
import FreeAgent.AgentPrelude
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec =
describe "FreeAgent" $ do
it "goes out in the world and does a thing" $
True `s... | jeremyjh/free-agent | core/test/FreeAgentSpec.hs | bsd-3-clause | 334 | 0 | 10 | 92 | 74 | 41 | 33 | 11 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.UI.GLUT.Callbacks
-- Copyright : (c) Sven Panne 2002-2005
-- License : BSD-style (see the file libraries/GLUT/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- Stability : stable
-- Portabili... | FranklinChen/hugs98-plus-Sep2006 | packages/GLUT/Graphics/UI/GLUT/Callbacks.hs | bsd-3-clause | 2,245 | 0 | 5 | 329 | 83 | 72 | 11 | 5 | 0 |
{-# LANGUAGE OverloadedStrings #-}
-- | XSD @dateTime@ data structure <http://www.w3.org/TR/xmlschema-2/#dateTime>
module Text.XML.XSD.DateTime
( DateTime(..)
, isZoned
, isUnzoned
, dateTime'
, dateTime
, toText
, fromZonedTime
, toUTCTime
, fromUTCTime
... | skogsbaer/xsd | Text/XML/XSD/DateTime.hs | bsd-3-clause | 8,178 | 0 | 19 | 2,577 | 2,107 | 1,099 | 1,008 | 166 | 4 |
{-# LANGUAGE FlexibleContexts #-}
module Data.Stack
( Stack
, evalStack
, push
, pop
) where
import Control.Applicative
import Control.Monad.State.Strict
type Stack a = State [a]
pop :: (Applicative m, MonadState [a] m) => m a
pop = gets head <* modify tail
push :: (Applicative m, MonadState [a] m) => a -> m ... | kirbyfan64/sodium | src/Data/Stack.hs | bsd-3-clause | 367 | 4 | 8 | 74 | 147 | 83 | 64 | 14 | 1 |
-- !!! Testing Read (assuming that Eq, Show and Enum work!)
module TestRead where
import Ratio(Ratio,Rational,(%))
import List(zip4,zip5,zip6,zip7)
import Char(isLatin1)
-- test that expected equality holds
tst :: (Read a, Show a, Eq a) => a -> Bool
tst x = read (show x) == x
-- measure degree of error
diff :: (Rea... | FranklinChen/Hugs | tests/rts/read.hs | bsd-3-clause | 2,665 | 0 | 11 | 521 | 1,056 | 589 | 467 | 44 | 1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
... | ezyang/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | 104,032 | 0 | 20 | 29,307 | 17,702 | 9,354 | 8,348 | 1,161 | 17 |
module J ( module J
, module J.Store
) where
import J.Store
data J = J { key :: String
, dst :: String
}
| KenetJervet/j | src/J.hs | bsd-3-clause | 147 | 0 | 8 | 67 | 42 | 27 | 15 | 5 | 0 |
module Diag.Util.RecursiveContents (getRecursiveContents) where
import Control.Monad (forM)
import System.Directory (doesDirectoryExist, getDirectoryContents)
import System.FilePath ((</>))
getRecursiveContents :: FilePath -> IO [FilePath]
getRecursiveContents topdir = do
names <- getDirectoryContents topdir
let... | marcmo/hsDiagnosis | src/Diag/Util/RecursiveContents.hs | bsd-3-clause | 593 | 0 | 15 | 100 | 180 | 95 | 85 | 15 | 2 |
{-# LANGUAGE RankNTypes, TypeOperators, DefaultSignatures #-}
-- | No comparison that I'm aware of
module MHask.Indexed.Layered where
import MHask.Arrow
import qualified MHask.Indexed.Join as MHask
import qualified MHask.Indexed.Duplicate as MHask
-- | IxLayered is its own dual.
class (MHask.IxJoin t, MHask.Ix... | DanBurton/MHask | MHask/Indexed/Layered.hs | bsd-3-clause | 1,543 | 0 | 14 | 422 | 360 | 199 | 161 | 17 | 0 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Servant.FileUpload.Client.GHC where
import Data.Proxy (Proxy (..))
import Data.Void (Void, absurd)
import Servant.API ((:>))
import Servant.Client (HasClient (..))
import Servan... | rimmington/servant-file-upload | servant-file-upload-client/src/Servant/FileUpload/Client/GHC.hs | bsd-3-clause | 550 | 0 | 8 | 83 | 139 | 82 | 57 | 14 | 0 |
module Chapter9Exercises where
import Data.Maybe
import Data.Char
-- exercise 2
str = "HbEfLrLxO"
onlyUpperHello = filter isUpper str
-- exercise 3
julie = "julie"
capitalize :: [Char] -> [Char]
capitalize [] = []
capitalize (a:as) = toUpper a : as
-- exercise 4
toAllUpper :: [Char] -> [Char]
toAllUpper [] = [... | brodyberg/Notes | ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/Chapter9.hs | mit | 1,403 | 0 | 14 | 265 | 367 | 206 | 161 | 26 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : ./Syntax/AS_Architecture.der.hs
Description : abstract syntax of CASL architectural specifications
Copyright : (c) Klaus Luettich, Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : till@informatik.uni-bremen.de
Stability : ... | spechub/Hets | Syntax/AS_Architecture.der.hs | gpl-2.0 | 3,505 | 0 | 8 | 1,164 | 492 | 282 | 210 | 42 | 0 |
-- Compiler Toolkit: compiler state management
--
-- Author : Manuel M. T. Chakravarty
-- Created: 2 November 95
--
-- Version $Revision: 1.1.1.1 $ from $Date: 2004/11/13 16:42:45 $
--
-- Copyright (c) [1995..1999] Manuel M. T. Chakravarty
--
-- This file is free software; you can redistribute it and/or modify
--... | k0001/gtk2hs | tools/c2hs/base/state/State.hs | gpl-3.0 | 12,092 | 0 | 15 | 3,880 | 2,022 | 1,156 | 866 | 130 | 3 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ParallelListComp #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
-- | A very simple Graphical User Interface (GUI) for user interaction with
-- but... | alphalambda/codeworld | codeworld-base/src/Extras/Widget.hs | apache-2.0 | 19,161 | 3 | 16 | 4,551 | 5,943 | 3,374 | 2,569 | 272 | 6 |
{-
Teak synthesiser for the Balsa language
Copyright (C) 2007-2010 The University of Manchester
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or... | Mahdi89/eTeak | src/Type.hs | bsd-3-clause | 21,407 | 0 | 15 | 5,813 | 6,632 | 3,349 | 3,283 | 378 | 6 |
module State.TreeSpec (treeSpec) where
import State.Tree
import Test.Hspec
import Control.Monad.Identity
testTree :: Integer -> Identity ([Integer], String)
testTree 0 = return ([1, 2], "0")
testTree 1 = return ([3], "1")
testTree 2 = return ([], "2")
testTree 3 = return ([], "3")
testTree _ = error "No node"
loopTr... | BakerSmithA/Turing | test/State/TreeSpec.hs | bsd-3-clause | 1,334 | 0 | 17 | 317 | 520 | 277 | 243 | 36 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables, BangPatterns #-}
module Halfs.Inode
(
InodeRef(..)
, blockAddrToInodeRef
, buildEmptyInodeEnc
, decLinkCount
, fileStat
, incLinkCount
, inodeKey
, inodeRefToBlockAddr
, isNilIR
, nilIR
, readStream
, writeStream
-- * for intern... | hackern/halfs | Halfs/Inode.hs | bsd-3-clause | 51,840 | 7 | 35 | 15,924 | 11,465 | 5,928 | 5,537 | 885 | 11 |
module RAM
( module RAM.Type
, module RAM.State
, Builtin (..)
)
where
-- $Id$
import RAM.Type
import RAM.Machine
import RAM.State
import RAM.Builtin | Erdwolf/autotool-bonn | src/RAM.hs | gpl-2.0 | 156 | 0 | 5 | 29 | 46 | 30 | 16 | 8 | 0 |
----------------------------------------------------------------------------
-- |
-- Module : Prelude
-- Copyright : (c) Sergey Vinokurov 2017
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : serg.foo@gmail.com
-- Created : 17 June 2017
-- Stability :
-- Portability :
--
--
--------------... | emacsmirror/flycheck-haskell | test/test-data/project-with-prelude-module/Prelude.hs | gpl-3.0 | 455 | 0 | 5 | 82 | 45 | 32 | 13 | 4 | 1 |
{-# LANGUAGE Rank2Types, RecordWildCards #-}
module OS.Internal
( OS(..)
, genericOS
)
where
import Data.Version (showVersion)
import Development.Shake
import Development.Shake.FilePath
import Dirs
import Paths
import Types
import Utils
data OS = OS
{
-- These paths are all on the target m... | erantapaa/haskell-platform | hptool/src/OS/Internal.hs | bsd-3-clause | 4,934 | 0 | 14 | 1,311 | 703 | 398 | 305 | 64 | 2 |
module SDL.Raw.Basic (
-- * Initialization and Shutdown
init,
initSubSystem,
quit,
quitSubSystem,
setMainReady,
wasInit,
-- * Configuration Variables
addHintCallback,
clearHints,
delHintCallback,
getHint,
setHint,
setHintWithPriority,
-- * Log Handling
log,
logCritical,
logDebug,
... | Velro/sdl2 | src/SDL/Raw/Basic.hs | bsd-3-clause | 6,592 | 0 | 11 | 1,039 | 1,725 | 887 | 838 | 146 | 1 |
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable #-}
-- | Types used while planning how to build everything in a project.
--
-- Primarily this is the 'ElaboratedInstallPlan'.
--
module Distribution.Client.ProjectPlanning.Types (
SolverInstallPlan,
-- * Elaborated install plan types
ElaboratedInstallPlan,
... | bennofs/cabal | cabal-install/Distribution/Client/ProjectPlanning/Types.hs | bsd-3-clause | 14,755 | 0 | 11 | 3,862 | 1,548 | 978 | 570 | 187 | 0 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
-- Determine which packages are already installed
module Stack.Build.Installed
( InstalledMap
, Installed (..)
, GetInstalledOpts (..)
, getInstalle... | duplode/stack | src/Stack/Build/Installed.hs | bsd-3-clause | 8,898 | 0 | 19 | 2,751 | 1,677 | 895 | 782 | 159 | 5 |
main = drawingOf(thing(1) & thing(2))
thing(n) = if n > 1 rectangle(n, n) else circle(n)
| venkat24/codeworld | codeworld-compiler/test/testcase/test_ifCondition/source.hs | apache-2.0 | 89 | 2 | 9 | 15 | 65 | 34 | 31 | -1 | -1 |
-- | This module provides numerical routines for minimizing linear and nonlinear multidimensional functions.
-- Multidimensional optimization is significantly harder than one dimensional optimization.
-- In general, there are no black box routines that work well on every function,
-- even if the function has only a sin... | arnabgho/HLearn | src/HLearn/Optimization/Multivariate.hs | bsd-3-clause | 18,644 | 0 | 19 | 5,117 | 4,575 | 2,449 | 2,126 | -1 | -1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="hu-HU">
<title>Front-End Scanner | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<m... | kingthorin/zap-extensions | addOns/frontendscanner/src/main/javahelp/org/zaproxy/zap/extension/frontendscanner/resources/help_hu_HU/helpset_hu_HU.hs | apache-2.0 | 978 | 78 | 67 | 159 | 417 | 211 | 206 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE CPP #-}
-- Copyright 2008 JP Bernardy
-- | ... | siddhanathan/yi | yi-language/src/Yi/Buffer/Basic.hs | gpl-2.0 | 2,288 | 0 | 10 | 463 | 596 | 326 | 270 | 47 | 1 |
module SDL.Raw.Platform (
-- * Platform Detection
getPlatform
) where
import Control.Monad.IO.Class
import Foreign.C.String
foreign import ccall "SDL.h SDL_GetPlatform" getPlatformFFI :: IO CString
getPlatform :: MonadIO m => m CString
getPlatform = liftIO getPlatformFFI
{-# INLINE getPlatform #-}
| dalaing/sdl2 | src/SDL/Raw/Platform.hs | bsd-3-clause | 306 | 0 | 6 | 45 | 65 | 38 | 27 | 8 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
#if __GLASGOW_HASKELL__ >= 707
{-# LA... | rpglover64/lens | src/Control/Lens/Internal/Magma.hs | bsd-3-clause | 9,589 | 0 | 13 | 1,992 | 3,322 | 1,709 | 1,613 | 168 | 1 |
{-# LANGUAGE UnboxedSums #-}
module UbxSumLevPoly where
-- this failed thinking that (# Any | True #) :: TYPE (SumRep [LiftedRep, b])
-- But of course that b should be Lifted!
-- It was due to silliness in TysWiredIn using the same uniques for different
-- things in mk_sum.
p = True
where (# _x | #) = (# | True #... | ezyang/ghc | testsuite/tests/unboxedsums/UbxSumLevPoly.hs | bsd-3-clause | 322 | 0 | 7 | 68 | 28 | 19 | 9 | 4 | 1 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances, TypeFamilies, GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module T4809_IdentityT
( evalIdentityT
, IdentityT(..)
, XML(..)
) where
import Control.Applicative (Applicative, Alternative)
import Control.... | philderbeast/ghcjs | test/ghc/typecheck/T4809_IdentityT.hs | mit | 1,601 | 0 | 15 | 353 | 464 | 258 | 206 | 30 | 1 |
module Vectorise.Generic.PADict
( buildPADict
) where
import Vectorise.Monad
import Vectorise.Builtins
import Vectorise.Generic.Description
import Vectorise.Generic.PAMethods ( buildPAScAndMethods )
import Vectorise.Utils
import BasicTypes
import CoreSyn
import CoreUtils
import CoreUnfold
import Module
import Ty... | urbanslug/ghc | compiler/vectorise/Vectorise/Generic/PADict.hs | bsd-3-clause | 4,973 | 0 | 19 | 1,600 | 819 | 433 | 386 | 72 | 1 |
{-# LANGUAGE Arrows #-}
{-# OPTIONS -fno-warn-redundant-constraints #-}
-- Test for Trac #1662
module Arrow where
import Control.Arrow
expr' :: Arrow a => a Int Int
expr' = error "urk"
term :: Arrow a => a () Int
term = error "urk"
expr1 :: Arrow a => a () Int
expr1 = proc () -> do
x <- term -< ()
... | urbanslug/ghc | testsuite/tests/arrows/should_compile/arrowpat.hs | bsd-3-clause | 433 | 2 | 10 | 133 | 166 | 82 | 84 | 16 | 1 |
-- | This is a library which colourises Haskell code.
-- It currently has six output formats:
--
-- * ANSI terminal codes
--
-- * LaTeX macros
--
-- * HTML 3.2 with font tags
--
-- * HTML 4.01 with external CSS.
--
-- * XHTML 1.0 with internal CSS.
--
-- * mIRC chat client colour codes.
--
module Language.Haskell.HsC... | kyoungrok0517/linguist | samples/Haskell/HsColour.hs | mit | 4,949 | 0 | 11 | 1,333 | 1,173 | 644 | 529 | 75 | 4 |
-- Hugs failed this test Jan06
module Mod172 where
import Mod172_B (f,g)
| urbanslug/ghc | testsuite/tests/module/mod172.hs | bsd-3-clause | 75 | 0 | 5 | 14 | 16 | 11 | 5 | 2 | 0 |
module Ghci025C (f, g, h) where
import Ghci025D
g x = f x + 1
h x = x `div` 2
data C = C {x :: Int}
| urbanslug/ghc | testsuite/tests/ghci/scripts/Ghci025C.hs | bsd-3-clause | 104 | 0 | 8 | 32 | 62 | 36 | 26 | 5 | 1 |
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Turtle
main = stdout $ input "README.md"
| JoshuaGross/haskell-learning-log | Code/turtle/input.hs | mit | 164 | 0 | 6 | 33 | 19 | 11 | 8 | 3 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : TestQueue
-- Copyright : (c) Phil Hargett 2014
-- License : MIT (see LICENSE file)
--
-- Maintainer : phil@haphazardhouse.net
-- Stability : experimental
-- Portability : non-portable (requires STM)
--
--... | hargettp/distributed-containers | test/TestQueue.hs | mit | 4,727 | 0 | 34 | 1,235 | 1,068 | 524 | 544 | 82 | 1 |
module ListyInstances where
import Data.Monoid
import Listy
instance Monoid (Listy a) where
mempty = Listy []
mappend (Listy l) (Listy l') = Listy $ mappend l l'
| diminishedprime/.org | reading-list/haskell_programming_from_first_principles/orphan-instance/ListyInstances.hs | mit | 167 | 0 | 8 | 32 | 67 | 35 | 32 | 6 | 0 |
import Data.List
import Data.List.Extra
import Data.Maybe
import qualified Data.Map as Map
parseLine :: String -> [Int]
parseLine s =
let [name, _, _, speed, "km/s", _, endurance, "seconds,",
_, _, _, _, _, rest, "seconds."] = words s
in
concat $ repeat $ replicate (read endurance) (read speed) ++ repl... | msullivan/advent-of-code | 2015/A14b.hs | mit | 1,018 | 0 | 11 | 214 | 421 | 234 | 187 | 28 | 2 |
module Problem8 ( removeDuplicates ) where
removeDuplicates :: (Eq a) => [a] -> [a]
removeDuplicates [] = []
removeDuplicates [x] = [x]
removeDuplicates (x:xs) = if x == head xs then removeDuplicates xs else x : removeDuplicates xs | chanind/haskell-99-problems | Problem8.hs | mit | 232 | 0 | 7 | 38 | 99 | 54 | 45 | 5 | 2 |
lastPart :: Int -> [a] -> [a]
lastPart _ [] = []
lastPart _ [x] = [x]
lastPart x l@(h:t) | x > 0 = lastPart nx t
| otherwise = l
where nx = x - 1
firstPart :: Int -> [a] -> [a]
firstPart _ [] = []
firstPart _ [x] = [x]
firstPart x l@(h:t) | x > 0 = h:(firstPart nx t)
... | andrewaguiar/s99-haskell | p19.hs | mit | 660 | 0 | 8 | 251 | 336 | 170 | 166 | 18 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( getApplicationDev
, appMain
, develMain
, makeFoundation
-- * for DevelMain
, getApplicationRepl
, shutdownApp
-- * for GHCI
, handler
, db
) where
import Control.Monad.Logger (liftLoc, runLoggingT)
i... | darthdeus/reedink | Application.hs | mit | 6,680 | 0 | 16 | 1,721 | 1,024 | 548 | 476 | -1 | -1 |
{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-}
import Data.Acid
import Data.Acid.Centered
import Control.Monad (when)
import Control.Concurrent (threadDelay)
import System.Exit (exitSuccess, exitFailure)
import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
import Control.Exception (catch, SomeEx... | sdx23/acid-state-dist | test/SyncTimeout.hs | mit | 1,014 | 0 | 11 | 196 | 265 | 138 | 127 | 27 | 2 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Init (
(@/=), (@==), (==@)
, assertNotEqual
, assertNotEmpty
, assertEmpty
, isTravis
, BackendMonad
... | greydot/persistent | persistent-test/Init.hs | mit | 9,069 | 56 | 14 | 1,865 | 2,196 | 1,246 | 950 | 116 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import Hate
import Hate.Graphics
import Vec2Lens (x,y)
import Control.Applicative
import Control.Lens
import System.Random
-- sample 4
data Sehe = Sehe {
_pos :: Vec2,
_vel :: Vec2
}
makeLenses ''Sehe
data SampleStat... | maque/Hate | samples/sample_sprite.hs | mit | 1,876 | 6 | 13 | 572 | 537 | 299 | 238 | -1 | -1 |
import System.Environment
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= 18.5 = "You're underweight, you emo, you!"
| bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise ... | dmitrinesterenko/haskell_io_examples | bmiCalc.hs | mit | 503 | 3 | 11 | 130 | 147 | 74 | 73 | 11 | 1 |
-- Write a function that takes a list and returns the same list in reverse
module Main (reverseList) where
aux [] acc = acc
aux (h:t) acc = aux t (h:acc)
reverseList xs = aux xs []
| ryanplusplus/seven-languages-in-seven-weeks | haskell/day1/reverse_list.hs | mit | 189 | 0 | 7 | 45 | 66 | 35 | 31 | 4 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html
module Stratosphere.ResourceProperties.ElasticLoadBalancingLoadBalancerPolicies where
im... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/ElasticLoadBalancingLoadBalancerPolicies.hs | mit | 4,306 | 0 | 13 | 370 | 536 | 306 | 230 | 45 | 1 |
module Book ( Book, load, compile ) where
import Control.Applicative
import Control.Arrow
import Control.Dangerous hiding ( Exit, Warning, execute )
import Control.Monad
import Control.Monad.Trans
import Data.List
import Data.Focus
import Data.Maybe
import Data.Scope
import System.FilePath
import System.FilePath.Utils
... | Soares/Bookbuilder | src/Book.hs | mit | 4,473 | 0 | 17 | 1,171 | 1,391 | 705 | 686 | -1 | -1 |
{-# Language ParallelListComp #-}
{-# Language ViewPatterns #-}
{-# Language RecordWildCards #-}
{-# Language ScopedTypeVariables #-}
module Symmetry.IL.Model.HaskellSpec where
import Data.Generics
import Data.Foldable as Fold
import Data.List
import Data.Maybe
import ... | gokhankici/symmetry | checker/src/Symmetry/IL/Model/HaskellSpec.hs | mit | 16,206 | 1 | 17 | 5,599 | 6,274 | 3,288 | 2,986 | 365 | 3 |
import Graphics.Rendering.Cairo
data Point = Point Double Double
data Vector = Vector Double Double
data RGBA = RGB Double Double Double
| RGBA Double Double Double Double
mkVector (Point x0 y0) (Point x1 y1) =
Vector (x1 - x0) (y1 - y0)
points = [Point 200 100, Point 100 300, Point 300 200]
segments ... | jsavatgy/xroads-game | code/orange-lines.hs | gpl-2.0 | 1,341 | 0 | 17 | 324 | 574 | 272 | 302 | 48 | 1 |
#!/usr/bin/env runghc
import System.IO
import System.Environment
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Data.AutoDecompress
import Control.Concurrent
main = do
args <- getArgs
case args of
("-t":files) -> mapM_ (fileLength True) files
("-l":files) -> lotsO... | drpowell/auto-decompress | t.hs | gpl-2.0 | 1,302 | 0 | 20 | 431 | 440 | 218 | 222 | 36 | 4 |
module Exp where
data Exp = Lit Int
| Neg Exp
| Add Exp Exp
deriving (Eq, Show)
ti1 = Add (Lit 8) (Neg (Add (Lit 1) (Lit 2)))
| capitanbatata/sandbox | tagless/src/Exp.hs | gpl-3.0 | 155 | 0 | 11 | 58 | 78 | 42 | 36 | 6 | 1 |
import Data.List (group, sort, nub)
import Text.Printf (printf)
main :: IO()
main = do
content <- fmap lines getContents
let x = map read $ words $ last content
printf "%.1f\n" $ mean x
printf "%.1f\n" $ median x
putStrLn $ show $ mode x
printf "%.1f\n" $ stdev x
(\(a,b) -> print... | woodsjc/hackerrank-challenges | ai_section/stat_warmup.hs | gpl-3.0 | 1,383 | 3 | 18 | 447 | 686 | 341 | 345 | 35 | 2 |
module Evaluator where
import qualified AST as P
data Value =
VBool Bool
|VInt Integer
deriving Show
eval::P.Term -> Maybe Value
eval P.STrue = Just (VBool True)
eval P.SFalse = Just (VBool False)
eval P.SZero = Just (VInt 0)
eval (P.SIsZero t) =
case eval t of
Just (VInt i) -> Just (VBool... | jmoy/pierce-arith | Evaluator.hs | gpl-3.0 | 673 | 0 | 13 | 195 | 357 | 175 | 182 | 27 | 6 |
import Test.QuickCheck
import Data.Maybe
import Data.List
-- These functions are copied directly from problem #11.
data EncodedEntry a = Multiple (Int, a) | Single a deriving (Eq, Show, Ord)
listToEncodedEntry :: [a] -> Maybe (EncodedEntry a)
listToEncodedEntry x =
case length x of
0 -> Nothing
1 -> Just . Sing... | CmdrMoozy/haskell99 | 012.hs | gpl-3.0 | 927 | 2 | 10 | 173 | 341 | 180 | 161 | 21 | 3 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
... | deepfire/youtrack | src/Youtrack/Exchanges.hs | gpl-3.0 | 7,677 | 0 | 13 | 2,069 | 1,498 | 829 | 669 | -1 | -1 |
module Utils where
import Data.List (partition)
import Types (Ingredient (..), showFrac, showUnit)
safeLookup :: [a] -> Int -> Maybe a
safeLookup [] _ = Nothing
safeLookup (a : _) 0 = Just a
safeLookup (_ : as) n = safeLookup as (n - 1)
padLeft :: Int -> String -> String
padLeft n xs =
let d = n - length xs
in ... | JackKiefer/herms | src/Utils.hs | gpl-3.0 | 2,042 | 0 | 22 | 602 | 596 | 312 | 284 | 48 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeF... | merijn/GPU-benchmarks | benchmark-analysis/src/Schema/Model/V5.hs | gpl-3.0 | 1,149 | 0 | 8 | 179 | 132 | 85 | 47 | 22 | 0 |
{-# LANGUAGE OverloadedStrings, NamedFieldPuns #-}
{-# OPTIONS_GHC -fno-warn-overlapping-patterns#-}
module Hash (
module Object.Hash
, vhash
, insert
, index
, keys
, values
, toArray
) where
import Data.Foldable (toList)
import qualified Data.HashMap.Strict as H
import Object
import Object.Hash
i... | antarestrader/sapphire | Hash.hs | gpl-3.0 | 1,905 | 0 | 12 | 372 | 889 | 469 | 420 | 56 | 2 |
-- (c) 2002 by Martin Erwig [see file COPYRIGHT]
-- | Monadic Graph Algorithms
module Data.Graph.Inductive.Query.Monad(
-- * Additional Graph Utilities
mapFst, mapSnd, (><), orP,
-- * Graph Transformer Monad
GT(..), apply, apply', applyWith, applyWith', runGT, condMGT', recMGT',
condMGT, re... | ckaestne/CIDE | CIDE_Language_Haskell/test/FGL-layout/Graph/Inductive/Query/Monad.hs | gpl-3.0 | 8,193 | 0 | 25 | 2,523 | 3,207 | 1,674 | 1,533 | 111 | 3 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE... | fmapfmapfmap/amazonka | core/src/Network/AWS/Types.hs | mpl-2.0 | 20,701 | 0 | 15 | 5,925 | 4,770 | 2,650 | 2,120 | 516 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-apps-calendar/gen/Network/Google/Resource/Calendar/Settings/List.hs | mpl-2.0 | 4,140 | 0 | 16 | 926 | 507 | 301 | 206 | 72 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/ListJobsByPipeline.hs | mpl-2.0 | 5,645 | 0 | 12 | 1,189 | 751 | 443 | 308 | 80 | 1 |
module Kata(tailSwap) where
import Data.List.Split
tailSwap :: (String, String) -> (String, String)
tailSwap (a, b) = let (a1 : (a2 : _)) = splitOn ":" a
(b1 : (b2 : _)) = splitOn ":" b in
(a1 ++ ":" ++ b2, b1 ++ ":" ++ a2)
--
| ice1000/OI-codes | codewars/1-100/tail-swap.hs | agpl-3.0 | 254 | 0 | 12 | 74 | 129 | 72 | 57 | 6 | 1 |
module Network.Haskoin.Wallet.KeyRing
(
-- *Database KeyRings
initWallet
, newKeyRing
, keyRings
, keyRingSource
, getKeyRing
-- *Database Accounts
, accounts
, accountSource
, newAccount
, addAccountKeys
, getAccount
, isMultisigAccount
, isReadAccount
, isCompleteAccount
-- *Database Addresses
, getAddress
, addr... | plaprade/haskoin-wallet | Network/Haskoin/Wallet/KeyRing.hs | unlicense | 29,202 | 0 | 25 | 8,920 | 7,250 | 3,704 | 3,546 | -1 | -1 |
module Triangle (area) where
area :: Float -> Float -> Float
area b h = b * h | tonilopezmr/Learning-Haskell | Exercises/3/Exercise 1/Triangle.hs | apache-2.0 | 80 | 0 | 6 | 20 | 36 | 20 | 16 | 3 | 1 |
module KeyBind
( Key (..)
, Keyset
, updateKeyset
, keysetToXY
) where
import Data.Complex
import Data.Set
import Graphics.UI.SDL
import Graphics.UI.SDL.Keysym
data Key = A | B | C | RB | LB | UB | DB | QUIT
deriving (Eq, Ord, Show)
type Keyset = Set Key
eventToKey :: Event -> Keyset -> Keyset
eventToKe... | c000/PaperPuppet | src/KeyBind.hs | bsd-3-clause | 1,216 | 0 | 12 | 345 | 532 | 270 | 262 | 42 | 2 |
{-# LANGUAGE
CPP
, DeriveDataTypeable
, FlexibleInstances
, FlexibleContexts
, MultiParamTypeClasses
, TypeFamilies
, UndecidableInstances #-}
{- |
Copyright : (c) Andy Sonnenburg 2013
License : BSD3
Maintainer : andy22286@gmail.com
-}
module Data.Tuple.IO
( module Data.Tuple.MTuple
... | sonyandy/var | src/Data/Tuple/IO.hs | bsd-3-clause | 5,909 | 0 | 10 | 1,754 | 1,827 | 963 | 864 | 171 | 0 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module Control.ConstraintClasses.Key
(
-- * Key classes
CKey
) where
import Prelude hiding (lookup)
import Data.Functor.Identity
import Data.Functor.Product
import Data.Func... | guaraqe/constraint-classes | src/Control/ConstraintClasses/Key.hs | bsd-3-clause | 1,028 | 0 | 7 | 155 | 250 | 153 | 97 | 24 | 0 |
module Khronos.AssignModules
( assignModules
) where
import Algebra.Graph.AdjacencyIntMap
hiding ( empty )
import qualified Data.IntMap.Strict as IntMap
import qualified Data.IntSet as Set
import qualified Data.List.Extra ... | expipiplus1/vulkan | generate-new/khronos-spec/Khronos/AssignModules.hs | bsd-3-clause | 19,322 | 0 | 25 | 5,155 | 4,659 | 2,389 | 2,270 | -1 | -1 |
{-# LANGUAGE DeriveFunctor, LambdaCase #-}
module Data.Boombox.Head where
import Data.Boombox.Player
import Data.Boombox.Tape
import Control.Comonad
import Control.Applicative
-- | 'Head' is a Store-like comonad which handles seeking.
data Head i a = Head !i (Maybe i -> a) deriving Functor
instance Comonad (Head i) w... | fumieval/boombox | src/Data/Boombox/Head.hs | bsd-3-clause | 1,274 | 0 | 14 | 291 | 563 | 287 | 276 | 27 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Configuration.Screen where
import Lens.Simple ( makeLenses
, (^.)
)
import Data.Yaml ... | rumblesan/proviz | src/Configuration/Screen.hs | bsd-3-clause | 1,069 | 0 | 11 | 474 | 183 | 108 | 75 | 25 | 1 |
module Main where
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Control.Monad.IO.Class
import Data.Aeson
import Data.DateTime (DateTime)
import Data.Function
import Data.Monoid
import Data.Text (Text)
import Network.API.Builder
import Reddit
import Reddit.Types.Subreddit
import Reddi... | intolerable/year-beast | src/Main.hs | bsd-3-clause | 3,857 | 0 | 14 | 795 | 1,166 | 607 | 559 | -1 | -1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Migrate.Internal.Types
( TransferMonad
, TransferState(..)
, TransactionError(..)
, getInformation, get, write, append, modify, getPreviousError
, runTransferMonad
) where
import ClassyPrel... | JustusAdam/bitbucket-github-migrate | src/Migrate/Internal/Types.hs | bsd-3-clause | 2,765 | 0 | 15 | 727 | 747 | 400 | 347 | 61 | 1 |
{-# LANGUAGE MagicHash, UnboxedTuples #-}
module CasIORef (casIORef) where
import GHC.IORef
import GHC.STRef
import GHC.Exts
import GHC.IO
casIORef :: IORef a -> a -> a -> IO Bool
casIORef (IORef (STRef r#)) old new = IO $ \s ->
case casMutVar# r# old new s of
(# s', did, val #) ->
if did ==# 0# then ... | mono0926/ParallelConcurrentHaskell | CasIORef.hs | bsd-3-clause | 379 | 0 | 11 | 107 | 135 | 74 | 61 | 12 | 2 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{- | some internal definit... | ariep/TCache | src/Data/TCache/Defs.hs | bsd-3-clause | 10,379 | 0 | 17 | 2,478 | 2,523 | 1,329 | 1,194 | 210 | 2 |
{-# LANGUAGE CPP #-}
--
-- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
--
--------------------------------------------------------------
-- Converting Core to STG Syntax
--------------------------------------------------------------
-- And, as we have the info in hand, we may convert some lets to
-- le... | GaloisInc/halvm-ghc | compiler/stgSyn/CoreToStg.hs | bsd-3-clause | 46,809 | 0 | 21 | 14,186 | 7,731 | 4,211 | 3,520 | -1 | -1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
@Uniques@ are used to distinguish entities in the compiler (@Ids@,
@Classes@, etc.) from each other. Thus, @Uniques@ are the basic
comparison key in the compiler.
If there is any single operation that needs to be fast, i... | sdiehl/ghc | compiler/basicTypes/Unique.hs | bsd-3-clause | 15,888 | 0 | 12 | 3,898 | 1,920 | 1,077 | 843 | 167 | 3 |
{-# OPTIONS_GHC -Wall #-}
module DFS where
import Types
import Unify
import Control.Monad (forM, liftM)
import Control.Monad.Error (strMsg, throwError)
import Control.Monad.State (gets)
import Data.Maybe (catMaybes)
--import Debug.Trace
getM... | osa1/MANTI | src/DFS.hs | bsd-3-clause | 2,117 | 0 | 13 | 585 | 766 | 390 | 376 | 44 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Text as Text
import Graphics.Blank
import Paths_blank_canvas_examples (getDataDir)
-- A bare-bones demonstration of loading and playing/pausing an audio file.
main :: IO ()
main = do
dat <- getDataDir
blankCanvas 3000 { events = ["mousedow... | ku-fpg/blank-canvas | examples/audio/Main.hs | bsd-3-clause | 1,972 | 0 | 15 | 452 | 474 | 243 | 231 | 40 | 3 |
module CF where
-- http://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_NG,_Contined_Fraction_N)#NG
-- represents the homographic transform
-- a1*z + a
-- f(z) --> --------
-- b1*z + b
import Data.Natural
import Data.List (inits)
data NG = NG {a1 :: Natural, a :: Natural, b1 :: Natur... | rzil/CF-Agda | CF.hs | bsd-3-clause | 2,476 | 0 | 14 | 642 | 1,507 | 816 | 691 | 51 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Network.Hawk.Internal.Types where
import Control.Applicative
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as BL
import Data.Text (Text)
import Data.Time.Clock.POSIX ... | rvl/hsoz | src/Network/Hawk/Internal/Types.hs | bsd-3-clause | 3,669 | 0 | 9 | 948 | 407 | 267 | 140 | 47 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.