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 OverloadedStrings, DeriveDataTypeable #-}
module ViewModels.LinkedTileViewModel where
import Data.Text
import Data.Data
data LinkedTileViewModel = LinkedTileViewModel {
url :: Text,
text :: Text,
title :: Text
} deriving (Data, Typeable)
| itsuart/fdc_archivist | src/ViewModels/LinkedTileViewModel.hs | mit | 262 | 0 | 8 | 41 | 55 | 34 | 21 | 9 | 0 |
module Jenkins.Types
( Job(..)
, JobList(..)
, JobStatus(..)
, RawBuild(..)
, JobWithBuildNums(..)
, JobWithBuilds(..)
, Branch(..)
, BuildNum(..)
, Build(..)
, BuildRev(..)
, Action(..)
) where
import Control.Applicative
import qualified Data.Text as T
import qualified Data.HashMap.Strict as ... | afiore/jenkins-tty.hs | src/Jenkins/Types.hs | mit | 7,626 | 0 | 18 | 2,272 | 2,032 | 1,087 | 945 | 180 | 9 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distributed.Data.Queue
-- Copyright : (c) Phil Hargett 2014
--... | hargettp/distributed-containers | src/Distributed/Data/Queue.hs | mit | 4,395 | 0 | 23 | 1,090 | 1,321 | 690 | 631 | 98 | 2 |
module CaesarCipher where
import Data.Char
caesarCipher :: Int -> String -> String
caesarCipher n s = map (\c -> chr (ord 'a' + ((ord . toLower $ c) - ord 'a' + n) `mod` 26)) s
uncaesarCipher :: Int -> String -> String
uncaesarCipher n s = map (\c -> chr (ord 'a' + ((ord . toLower $ c) - ord 'a' - n) `mod` 26)) s... | NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter13/caesarCipher/src/CaesarCipher.hs | mit | 322 | 0 | 17 | 74 | 169 | 90 | 79 | 6 | 1 |
import Primes
import Data.Array
import Debug.Trace
nMax = 100
arr = array ((0,0), (nMax, nMax)) $ [ ((n,d), countSplits' n d) | n <- [0..nMax], d <- [0..nMax] ]
countSplits' n largest | trace ("call: " ++ show n ++ " " ++ show largest) False = undefined
countSplits' n 0 | n>0 = 0
countSplits' 0 _ = 1
countSplits' n l... | arekfu/project_euler | p0077/p0077.hs | mit | 704 | 0 | 19 | 145 | 356 | 188 | 168 | 11 | 2 |
{-|
Module : PostgREST.DbRequestBuilder
Description : PostgREST database request builder
This module is in charge of building an intermediate representation(ReadRequest, MutateRequest) between the HTTP request and the final resulting SQL query.
A query tree is built in case of resource embedding. By inferring th... | begriffs/postgrest | src/PostgREST/DbRequestBuilder.hs | mit | 17,542 | 0 | 25 | 4,343 | 4,533 | 2,412 | 2,121 | 249 | 11 |
module Main where
import Prelude hiding (writeFile)
import Numerical
import Vec3
import Scene
import Primitive
import Microphone
import Material
import Container
import System.Environment
import Pipes
import qualified Pipes.ByteString as P
import System.IO hiding (writeFile)
import Pipes.Aeson.Unchecked
primitive... | reuk/rayverb | tracer/Tracer.hs | gpl-2.0 | 2,046 | 0 | 12 | 834 | 681 | 352 | 329 | 49 | 2 |
{-| Implementation of Ganeti Lock field queries
The actual computation of the field values is done by forwarding
the request; so only have a minimal field definition here.
-}
{-
Copyright (C) 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General... | badp/ganeti | src/Ganeti/Query/Locks.hs | gpl-2.0 | 1,786 | 0 | 7 | 383 | 167 | 95 | 72 | 17 | 1 |
-- |
-- Module : System.Dzen.Bars
-- Copyright : (c) 2009 Felipe A. Lessa
-- License : GPL 3 (see the LICENSE file in the distribution)
--
-- Maintainer : felipe.lessa@gmail.com
-- Stability : experimental
-- Portability : semi-portable (uses MPTC and type families)
--
-- Drawing of progress bars (s... | ianclement/dzen-utils | System/Dzen/Bars.hs | gpl-3.0 | 11,184 | 0 | 15 | 3,989 | 2,422 | 1,356 | 1,066 | 192 | 3 |
module Main where
-- from other packages from others
import Control.Monad.Identity
import Control.Monad.Error
import System.Exit (exitFailure, exitSuccess)
-- from this package
import Test.EventChain.Common
import Test.EventChain.LHEParse
import Test.EventChain.Match
import Test.EventChain.Spec
main :: IO ()
main =... | wavewave/evchain | test/test-evchain.hs | gpl-3.0 | 941 | 0 | 13 | 179 | 261 | 135 | 126 | 25 | 1 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 karamellpelle@hotmail.com
--
-- This file is part of grid.
--
-- grid 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 Lice... | karamellpelle/grid | source/Game/LevelPuzzle/LevelPuzzleWorld/Content/Plain.hs | gpl-3.0 | 6,227 | 0 | 8 | 1,907 | 255 | 153 | 102 | 29 | 1 |
-- This module defines an instance for the list type for the Edit type class.
module ListManipLib (edit, subst, cut, reverseFrom, splice) where {
import Char;
instance Edit [a] where {
edit xs path = [
("Cut", fCut),
("Copy", fCopy),
("Copy by ... | ckaestne/CIDE | CIDE_Language_Haskell/test/fromviral/ListManipLib.hs | gpl-3.0 | 5,348 | 0 | 13 | 1,969 | 1,596 | 866 | 730 | 110 | 2 |
-- H<app-name>, a haskell implementation of GNU <app-name>.
module Main where
import System.Environment
import System.Console.Terminfo.Base
import Data.List
main :: IO ()
main = do
term <- setupTermFromEnv
args <- getArgs
let options = processArgs args default<app-name>
runTermOutput term (termText (showHelp ... | PuZZleDucK/Hls | skeleton.hs | gpl-3.0 | 1,907 | 28 | 15 | 396 | 665 | 343 | 322 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Clusters/InjectCredentials.hs | mpl-2.0 | 7,024 | 0 | 18 | 1,539 | 933 | 545 | 388 | 142 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Commands.CIA
(
cia,
fbi,
fiveeyes
)
where
import Control.Applicative
import Control.Monad.Random.Class
import Data.Response
import Data.Maybe
import Data.Monoid
import Network.IRC
import Data.Attoparsec.ByteString.Char8 (string)
import qualified Data.ByteString.Cha... | tsahyt/lmrbot | src/Commands/CIA.hs | agpl-3.0 | 1,360 | 0 | 15 | 334 | 428 | 221 | 207 | 35 | 1 |
module AlphabeticAnagrams where
import Data.List
-- import Data.Bits
-- type BIT = [Int]
extract :: Maybe a -> a
extract (Just a) = a
mapChar :: [Char] -> Char -> Integer
mapChar cs c = toInteger $ extract $ elemIndex c cs
mapString :: [Char] -> String -> [Integer]
mapString cs = map $ \x -> toInteger $ mapChar cs... | ice1000/OI-codes | codewars/1-100/alphabetic-anagrams.hs | agpl-3.0 | 920 | 0 | 8 | 231 | 262 | 143 | 119 | 15 | 1 |
module ProductFusion where
import Data.Char (digitToInt)
import Products
productFusionLeft,productFusionRight :: (c -> a) -> (c -> b) -> (d -> c) -> d -> (a, b)
productFusionLeft g h f = pair g h . f
productFusionRight g h f = pair (g . f) (h . f)
pf = [
productFusionLeft (*2) sho... | haroldcarr/learn-haskell-coq-ml-etc | haskell/book/2019-Program_Design_by_Calculation-Oliveira/2015-05-LambdaConf/ProductFusion.hs | unlicense | 868 | 0 | 10 | 403 | 306 | 175 | 131 | 16 | 1 |
module Main where
import Data.Function
import qualified Data.Map.Strict as Map
import Utils.Fasta
gcContent :: String -> Float
gcContent s = ((length filteredContent) `intDiv` (length s)) * 100.0
where
filteredContent = filter (\c -> (c == 'C') || (c == 'G')) s
intDiv = (/) `on` fromIntegral
ma... | ctimmons/hs_rosalind | 4 - Computing GC Content/Main.hs | unlicense | 841 | 0 | 12 | 192 | 299 | 165 | 134 | 20 | 2 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
-- | A Service monitoring.
--
-- Here we do merely use deptrack to record service dependencies for some
-- internet hosts that I own.
module Service where
import Prelude hiding (lookup)
import Deptrack.Graph
import Deptrack.Monadic
import Data.Traver... | lucasdicioccio/deptrack | examples/Service.hs | apache-2.0 | 5,546 | 0 | 16 | 1,465 | 1,902 | 969 | 933 | 135 | 2 |
{-# LANGUAGE GADTs, KindSignatures, DataKinds #-}
module Sysops where
{- would be great to support something like
-
- worker = dep $ do
- x `remote` (nat >> service "my-worker" [])
-
- we may want to explicit remotable actions from non-remotable,
- GADTs/phantom types may help ensuring we only const... | lucasdicioccio/deptrack | examples/sysops.hs | apache-2.0 | 7,230 | 0 | 16 | 1,768 | 2,244 | 1,175 | 1,069 | 147 | 5 |
-- Copyright 2011 The Text.XHtml Authors.
--
-- 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.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law ... | robinbb/hs-text-xhtml | Text/XHtml/Internals.hs | apache-2.0 | 11,039 | 32 | 15 | 3,049 | 2,399 | 1,298 | 1,101 | 183 | 6 |
module Set1
( challenge1
, challenge2
, challenge3
, challenge4
, challenge5
, challenge6
, challenge7
, challenge8
) where
import Lib
import qualified Debug.Trace as Debug
import Numeric (showHex)
import Data.Bits
import qualif... | mjec/cryptopals-haskell | src/Set1.hs | bsd-3-clause | 9,064 | 0 | 17 | 2,570 | 2,566 | 1,345 | 1,221 | 140 | 3 |
-- Little Bob loves chocolates, and goes to the store with cash in his pocket. The price of each chocolate is price. The store offers a discount: for every 'wrappers needed' number of wrappers he gives the store, he’ll get one chocolate for free.
--
-- The free chocolate program has been successful, and they've decide... | jleakakos/haskell-code-test | src/old/ChocolateShop.hs | bsd-3-clause | 4,931 | 0 | 13 | 749 | 549 | 326 | 223 | 30 | 1 |
{-# LANGUAGE NPlusKPatterns #-}
module Code11 where
mnss0 :: [Int] -> Int
mnss0 = maximum . map sum . nonsegs
markings :: [a] -> [[(a,Bool)]]
markings xs = [zip xs bs | bs <- booleans (length xs)]
booleans :: Int -> [[Bool]]
booleans 0 = [[]]
booleans (n+1) = [b:bs | b <- [True,False],... | sampou-org/pfad | Code/Code11.hs | bsd-3-clause | 2,188 | 1 | 12 | 668 | 1,252 | 714 | 538 | 55 | 1 |
module Nitpick.PatternMatches (patternMatches) where
import Control.Arrow (second)
import qualified Data.Foldable as F
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import qualified Data.Set as Set
import qualified AST.Expression.General as E
import qualified AST.Expression.Canonical as Canoni... | JoeyEremondi/elm-pattern-effects | src/Nitpick/PatternMatches.hs | bsd-3-clause | 9,011 | 0 | 18 | 2,591 | 2,649 | 1,354 | 1,295 | 262 | 18 |
-----------------------------------------------------------------------------
-- |
-- Module : Graphics.X11.Xlib.Context
-- Copyright : (c) Alastair Reid, 1999-2003
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : provisional
-- Port... | FranklinChen/hugs98-plus-Sep2006 | packages/X11/Graphics/X11/Xlib/Context.hs | bsd-3-clause | 8,228 | 62 | 13 | 1,830 | 1,134 | 656 | 478 | 83 | 1 |
{-#LANGUAGE OverloadedStrings #-}
-- | This module replicates `pipes-http` as closely as will type-check, adding a
-- conduit-like @http@ in @ResourceT@ and a primitive @simpleHTTP@ that emits
-- a streaming bytestring rather than a lazy one.
--
--
-- Here is an example GET request that streams the response bo... | michaelt/streaming-utils | Data/ByteString/Streaming/HTTP.hs | bsd-3-clause | 7,323 | 0 | 20 | 1,873 | 845 | 464 | 381 | 75 | 3 |
module LiveCoding where
stops = "pbtdkg"
vowels = "aeiou"
allStopVowelStop stops vowels =
[[s, v, s'] | s <- stops, s == 'p', v <- vowels, s' <- stops]
seekritFunc :: Fractional a => String -> a
seekritFunc x =
let blah = fromIntegral . length in
(/) (sum (map blah (words x))) (blah (words x))
myOr :: [Bool]... | taojang/haskell-programming-book-exercise | src/ch10/LiveCoding.hs | bsd-3-clause | 1,172 | 0 | 13 | 291 | 682 | 380 | 302 | 35 | 2 |
module JDec.Class.Parse.ParseAttribute (
deserializeAttribute
) where
import JDec.Class.Raw.Attribute (Attribute(ConstantValueAttribute, SyntheticAttribute, SignatureAttribute, DeprecatedAttribute, EnclosingMethodAttribute, SourceFileAttribute, StackMapTableAttribute, ExceptionsAttribute, CodeAttribute, InnerClassesA... | rel-eng/jdec | src/JDec/Class/Parse/ParseAttribute.hs | bsd-3-clause | 20,909 | 0 | 19 | 3,225 | 4,228 | 2,179 | 2,049 | 309 | 27 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.VertexBlend
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability ... | haskell-opengl/OpenGLRaw | src/Graphics/GL/ARB/VertexBlend.hs | bsd-3-clause | 2,140 | 0 | 5 | 292 | 289 | 184 | 105 | 59 | 0 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE Overl... | rfranek/duckling | Duckling/Ordinal/HR/Corpus.hs | bsd-3-clause | 1,203 | 0 | 9 | 432 | 186 | 116 | 70 | 34 | 1 |
module Module4.Task4 where
-- system code
data LogLevel = Error | Warning | Info
-- solution code
cmp :: LogLevel -> LogLevel -> Ordering
cmp a b = compare (i a) (i b) where
i Error = 2
i Warning = 1
i Info = 0
| dstarcev/stepic-haskell | src/Module4/Task4.hs | bsd-3-clause | 230 | 0 | 7 | 65 | 87 | 47 | 40 | 7 | 3 |
module Internal.Mips.Default where
import Foreign
import Foreign.C.Types
import Hapstone.Internal.Mips
import Test.QuickCheck
import Test.QuickCheck.Instances
-- generators for our datatypes
instance Arbitrary MipsOpType where
arbitrary = elements [minBound..maxBound]
instance Arbitrary MipsOpMemStruct where
... | ibabushkin/hapstone | test/Internal/Mips/Default.hs | bsd-3-clause | 886 | 0 | 9 | 175 | 209 | 115 | 94 | 24 | 0 |
{-# LANGUAGE TypeOperators
, KindSignatures
, DataKinds
, TypeFamilies
, GADTs
, FlexibleInstances
, NoImplicitPrelude
, ScopedTypeVariables
, FlexibleContexts
, Rank2Types
#-}
{-# OPTIONS_GHC -Wall -fwarn-tab... | zachsully/hakaru | haskell/Language/Hakaru/Syntax/Prelude.hs | bsd-3-clause | 53,513 | 2 | 20 | 14,379 | 19,728 | 10,188 | 9,540 | 1,139 | 8 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import Ballast.Client
import Ballast.Types
import Data.Maybe (fromJust)
import Data.Monoid ((<>))
import qualified Data.Text as T
import Data.Time (Day(..), secondsToDiffTime)
impo... | bitemyapp/ballast | tests/tests.hs | bsd-3-clause | 40,944 | 0 | 30 | 12,273 | 9,162 | 4,425 | 4,737 | 815 | 3 |
{-# LANGUAGE TypeOperators, DeriveGeneric, DefaultSignatures, DeriveAnyClass, FlexibleContexts #-}
-- Source:
-- Section 7.5.4, "Deriving Typeable instances"
-- Section 7.6.1.4, "Default method signatures"
-- Section 7.5.6, "Deriving any other class"
-- Just a simple example of using GHC.Generics as a wa... | josefs/autosar | generics/GenPut.hs | bsd-3-clause | 1,938 | 0 | 11 | 452 | 362 | 193 | 169 | 22 | 0 |
{-|
Module : Idris.Docs
Description : Data structures and utilities to work with Idris Documentation.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE DeriveFunctor, MultiWayIf, PatternGuards #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Idris.Docs (
pprintDocs
... | ben-schulz/Idris-dev | src/Idris/Docs.hs | bsd-3-clause | 17,892 | 0 | 25 | 6,223 | 5,482 | 2,778 | 2,704 | 325 | 24 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE... | phadej/stack | src/Stack/PackageIndex.hs | bsd-3-clause | 17,765 | 0 | 20 | 5,885 | 4,183 | 2,128 | 2,055 | 357 | 10 |
{-# LANGUAGE LambdaCase #-}
module Opaleye.Internal.Optimize where
import Prelude hiding (product)
import qualified Opaleye.Internal.PrimQuery as PQ
import Opaleye.Internal.Helpers ((.:))
import qualified Data.List.NonEmpty as NEL
import Control.Applicative ((<$>), (<*>), pure)
impo... | hesselink/haskell-opaleye | src/Opaleye/Internal/Optimize.hs | bsd-3-clause | 2,755 | 0 | 15 | 889 | 850 | 451 | 399 | 51 | 9 |
-- | Accessors (lenses and functions) to operate on the 'PreFiltset'
-- part of a clatch-like type.
module Penny.Clatch.Access.PreFiltset where
import Control.Lens (Lens', _2, _1)
import Penny.Clatch.Types
-- | Operate on the 'PreFiltset'.
--
-- @
-- 'preFiltset' :: 'Lens'' ('Prefilt' a) 'PreFiltset'
-- 'preFiltset'... | massysett/penny | penny/lib/Penny/Clatch/Access/PreFiltset.hs | bsd-3-clause | 566 | 0 | 9 | 93 | 91 | 60 | 31 | 5 | 1 |
{-# LANGUAGE CPP #-}
module TcCanonical(
canonicalize,
unifyDerived,
makeSuperClasses, mkGivensWithSuperClasses,
StopOrContinue(..), stopWith, continueWith
) where
#include "HsVersions.h"
import TcRnTypes
import TcType
import Type
import TcFlatten
import TcSMonad
import TcEvidence
import Class
... | mcschroeder/ghc | compiler/typecheck/TcCanonical.hs | bsd-3-clause | 81,965 | 191 | 30 | 23,117 | 9,531 | 5,262 | 4,269 | -1 | -1 |
{-# LANGUAGE QuasiQuotes #-}
module Languages.I3 where
import DataTypes.Key
import DataTypes.Other
import Data.List (intercalate)
import Control.Monad.Free
import Data.String.Interpolate
import Data.String.Interpolate.Util
data Binding = BindSym [KeyName] ActionsWithCriteria | BindCode ShouldRelease Shortcut Action... | vshatskyi/i3wm-config-haskell | app/Languages/I3.hs | bsd-3-clause | 6,445 | 0 | 14 | 1,458 | 1,520 | 813 | 707 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
-------------------------------------------------------------------------------
-- |
-- Module : Database.Bloodhound.Client
-- Copyright : (C) 2014 Chris Allen
-- License : BSD-style (see the file LICENSE)
-- Maint... | bermanjosh/bloodhound | src/Database/V1/Bloodhound/Client.hs | bsd-3-clause | 38,317 | 0 | 20 | 8,811 | 8,488 | 4,472 | 4,016 | 590 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
-- |
-- Module : Crypto.Classical.Vigenere
-- Copyright : (c) Colin Woodbury, 2015... | fosskers/crypto-classical | lib/Crypto/Classical/Cipher/Vigenere.hs | bsd-3-clause | 1,482 | 17 | 8 | 320 | 151 | 123 | 28 | 24 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Language.LSP.Types.WorkspaceSymbol where
import Data.Aeson.TH
import Data.Default
import Language.LSP.Types.Common
import Language.LSP.Types.DocumentSymbol
import Language.LSP.Types.Progress
import Language.LSP.Types.Utils
import Dat... | alanz/haskell-lsp | lsp-types/src/Language/LSP/Types/WorkspaceSymbol.hs | mit | 3,170 | 0 | 11 | 849 | 420 | 242 | 178 | 57 | 0 |
module Util.Formatting
( formatZonedTimeVerbose
) where
import qualified Data.Time.Format as DTF
import qualified Data.Time.LocalTime as LT
import Prelude
formatZonedTimeVerbose :: LT.ZonedTime -> String
formatZonedTimeVerbose =
DTF.formatTime DTF.defaultTimeLocale "at %H:%M UTC%z on %A %-d %B %... | rcook/seattlehaskell-org | Util/Formatting.hs | mit | 323 | 0 | 6 | 59 | 57 | 36 | 21 | 8 | 1 |
module Handler.Who where
import Import
import Data.List (sortBy)
import Model.Markdown
userShortName :: User -> Text
userShortName user = fromMaybe (userIdent user) $ userName user
getWhoR :: Text -> Handler Html
getWhoR project_handle = do
Entity project_id project <- runYDB $ getBy404 $ UniqueProjectHandle ... | chreekat/snowdrift | Handler/Who.hs | agpl-3.0 | 953 | 0 | 16 | 210 | 272 | 135 | 137 | 21 | 1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- | Nix types.
module Stack.Types.Nix where
import Control.Applicative
import Data.Aeson.Extended
import Data.Monoid
import Data.Text (Text)
import GHC.Generics (Generic)
import Gene... | sjakobi/stack | src/Stack/Types/Nix.hs | bsd-3-clause | 3,223 | 0 | 14 | 631 | 495 | 283 | 212 | 77 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.HTML (tests) where
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
import Tests.Arbitrary()
import Text.Pandoc.Builder
import Text.Pandoc
import Text.Pandoc.Error
html :: String -> Pandoc
html = handleError . readHtml def
tests :: [Test... | janschulz/pandoc | tests/Tests/Readers/HTML.hs | gpl-2.0 | 1,474 | 0 | 13 | 278 | 236 | 126 | 110 | 25 | 1 |
module WhereIn1 where
f = (case (x, z) of
(1, 2) -> "First Branch"
_ -> "Second Branch")
where (x, z) = (1, 2)
f_1 = (case (x, z) of
(1, 2) -> return 0
_ -> return 1)
where (x, z) = (1, 2)
| kmate/HaRe | old/testing/simplifyExpr/WhereIn1AST.hs | bsd-3-clause | 254 | 0 | 9 | 110 | 122 | 71 | 51 | 9 | 2 |
{-# LANGUAGE CPP #-}
module Map (
Map,
member, lookup, findWithDefault,
empty,
insert, insertWith,
delete,
union, unionWith, unions,
mapWithKey,
elems,
fromList, fromListWith,
toAscList
) where
#if __GLASGOW_HASKELL__ >= 603
import Data.Map
import Prelude ()
#else
import Data.FiniteMap
im... | beni55/alex | src/Map.hs | bsd-3-clause | 1,489 | 0 | 4 | 382 | 69 | 47 | 22 | 45 | 1 |
module T9204 where
import {-# SOURCE #-} T9204
data D a
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/roles/should_fail/T9204.hs | bsd-3-clause | 59 | 0 | 3 | 14 | 12 | 9 | 3 | -1 | -1 |
{-# LANGUAGE TypeOperators, GADTs, KindSignatures #-}
-- Tests infix type constructors in GADT declarations
module ShouldCompile where
import Data.Kind
infix 1 `DArrowX` -- (->) has precedence 0
data DArrowX :: Type -> Type -> Type where
First :: a `DArrowX` a' -> (a,b) `DArrowX` (a',b)
| sdiehl/ghc | testsuite/tests/typecheck/should_compile/tc205.hs | bsd-3-clause | 304 | 0 | 8 | 61 | 68 | 44 | 24 | -1 | -1 |
{-# LANGUAGE KindSignatures, RankNTypes, PolyKinds, GADTs,
FlexibleContexts, DataKinds, TypeFamilies #-}
module T7020 where
import GHC.Exts
data family Sing (a :: k)
class SingKind (Any :: k) => SingI (s :: k) where
sing :: Sing s
data SingInstance (a :: k) where
SingInstance :: SingI a => Sing... | urbanslug/ghc | testsuite/tests/polykinds/T7020.hs | bsd-3-clause | 436 | 1 | 9 | 99 | 137 | 77 | 60 | 11 | 0 |
-- !!! Importing Tycon with duplicate constructor
module M where
import Prelude(Either(Left,Right,Right))
| ghc-android/ghc | testsuite/tests/module/mod83.hs | bsd-3-clause | 107 | 0 | 6 | 13 | 21 | 16 | 5 | 2 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Lish internal commands
module Lish.InternalCommands
( lookup
, toArg
)
where
import Data.Fix
import qualified Data.Map.Strict as Map
import qualified Data.Text as Text
import GHC.IO.Handle (hGetConte... | yogsototh/lish | src/Lish/InternalCommands.hs | isc | 10,099 | 1 | 19 | 2,883 | 3,741 | 1,902 | 1,839 | 267 | 4 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Turnip.Eval.Lib (loadBaseLibrary) where
import Turnip.Eval.Types
import Turnip.Eval.Util
import Turnip.Eval.UtilNumbers
import Turnip.Eval.Eval (callRef, callFunction, call)
import Turnip.Eval.Metatables
import qualified Turnip.Parser as Parser
imp... | bananu7/Turnip | src/Turnip/Eval/Lib.hs | mit | 9,832 | 0 | 16 | 2,181 | 2,935 | 1,450 | 1,485 | 182 | 5 |
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
import Control.Monad
instance Show LispVal where show = showVal
data LispVal = Atom String
| List [LispVal]
| DottedList [LispVal] LispVal
| Number Integer
| String String
| Bool Bool
unwordsList :: [LispVal] -> String... | mmwtsn/write-yourself-a-scheme | 03-evaluation/01-beginning-the-evaluator.hs | mit | 2,104 | 0 | 11 | 510 | 751 | 365 | 386 | 70 | 3 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Bits
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as B8
import System.Environment
import System.Exit
import System.IO
-- | Hamming distance between bytestrings.
--
-- Returns Nothing if bytestrings are of unequal length.
distance :: B.By... | jtobin/cryptopals | lib/hamming/Hamming.hs | mit | 944 | 1 | 17 | 254 | 290 | 147 | 143 | 27 | 3 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Data.ByteString.Base64.URL.Extended
( Base64
, encode
, unBase64
, fromByteString
, fromByteStringUnsafe
, decode
, fromTextUnsafe
, toByteString
)where
import Data.Aeson (FromJSON (..), To... | rubenmoor/skull | skull-server/src/Data/ByteString/Base64/URL/Extended.hs | mit | 1,918 | 0 | 10 | 482 | 468 | 270 | 198 | 48 | 2 |
-- | Describes the types of objects that can be encountered at runtime.
module Nix.Evaluator.RuntimeTypes where
import Nix.Common
import Nix.Atoms
import qualified Data.Text as T
-- | Runtime types of values.
data RuntimeType
= RT_Null
| RT_Bool
| RT_Int
| RT_String
| RT_Lambda
| RT_List
| RT_Set
| RT... | adnelson/nix-eval | src/Nix/Evaluator/RuntimeTypes.hs | mit | 752 | 0 | 8 | 139 | 177 | 100 | 77 | 22 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE TemplateHaskell #-}
module PrinterParser where
import qualified Control.Applicative as Applicative ((<$>))
import Control.Category ... | nightuser/parensprinter | src/PrinterParser.hs | mit | 7,196 | 0 | 15 | 1,778 | 2,305 | 1,204 | 1,101 | 147 | 8 |
module Sudoku.Strategy.NakedSingle where
import Data.Char
import Data.List
import Prelude
import Sudoku
import Sudoku.Strategy
resolveAllCandidates :: Sudoku -> [[(Char, String)]]
resolveAllCandidates su = mapWithIndeces su (\i j -> (su !! i !! j, findCandidates su i j))
| thomasbrus/sudoku-solver | src/Sudoku/Strategy/NakedSingle.hs | mit | 275 | 0 | 10 | 39 | 93 | 54 | 39 | 8 | 1 |
module Language.Binal.Util.LitKind where
import Language.Binal.Types
extractSym :: LitKind -> Maybe String
extractSym (SymLit s) = Just s
extractSym _ = Nothing
extractStr :: LitKind -> Maybe String
extractStr (StrLit s) = Just s
extractStr _ = Nothing
extractNum :: LitKind -> Maybe Double
extractNum (Num... | pasberth/binal1 | Language/Binal/Util/LitKind.hs | mit | 359 | 0 | 7 | 67 | 125 | 64 | 61 | 11 | 1 |
{-# OPTIONS_GHC -w #-}
{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6
{-# LANGUAGE ImplicitPrelude #-}
{-# OPTIONS -Wwarn -w #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the modul... | sumitsahrawat/IHaskell | ghc-parser/src-7.6/Language/Haskell/GHC/HappyParser.hs | mit | 934,547 | 26,060 | 145 | 127,374 | 287,093 | 155,308 | 131,785 | 24,366 | 139 |
module WMonad.Util
( whenM
, unlessM
, logp
, logs
) where
import Control.Monad
import Control.Monad.Logger
import Data.Text (pack)
whenM :: Monad m => m Bool -> m () -> m ()
whenM cond m = cond >>= flip when m
unlessM :: Monad m => m Bool -> m () -> m ()
unlessM cond m = cond >>= flip unless ... | nickspinale/wmonad | src/WMonad/Util.hs | mit | 472 | 0 | 9 | 126 | 221 | 113 | 108 | 16 | 1 |
module University
( Professor(..)
, Student(..)
, Class(..)) where
data Professor = Professor {
profFirstName :: String,
profLastName :: String,
almaMaters:: [String],
degrees:: [String],
yearsAtUniversity:: Int,
tenured:: Bool,
classesCurrentlyTeaching:: [String],
profDepa... | rtoal/ple | haskell/University.hs | mit | 880 | 0 | 9 | 208 | 246 | 158 | 88 | 33 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Y2017.M12.D18.Solution where
{--
Yesterday, we created the links for requesting an oembed component, today we
will receive an oembed request and then respond.
Reminder, the request looks something like
http://127.0.0.1:8080/services/oembed/?format=json&url=http%3A//127.0.0.... | geophf/1HaskellADay | exercises/HAD/Y2017/M12/D18/Solution.hs | mit | 4,131 | 0 | 12 | 793 | 459 | 267 | 192 | 34 | 2 |
{-# LANGUAGE ParallelListComp, ViewPatterns, DeriveDataTypeable, ImplicitParams, TemplateHaskell #-}
import Positioned hiding (ord)
import World
import Node
import Stepping
import Seq
import Timed
import List
import Data.Char
import Control.Concurrent.STM
import Control.Concurrent hiding (Chan)
import Prelude hidi... | paolino/touchnet | Render.hs | mit | 7,285 | 4 | 17 | 2,025 | 1,360 | 730 | 630 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- ----------------------------------------------------------------------------
{- |
Module : Holumbus.Index.Common.DocIdMap
Copyright : Copyright (C) 2013 Sebastian M. Schlatt,... | ichistmeinname/holumbus | src/Holumbus/Index/Common/DocIdMap.hs | mit | 8,014 | 0 | 14 | 2,579 | 1,775 | 935 | 840 | 144 | 1 |
module CoreSpec where
import Core
import Test.Hspec
import Control.Monad.Trans.State
import Control.Monad.Trans.Class
import Prelude hiding (take, drop)
fold :: Monad m => (r -> i -> r) -> r -> Pipe i o d m r
fold f =
loop
where
loop r = await >>= maybe (return r) (\i -> loop $! f r i)
yieldMany :: Monad m... | snoyberg/nonterminating-pipes | src/CoreSpec.hs | mit | 1,788 | 0 | 20 | 600 | 793 | 393 | 400 | 48 | 1 |
{-# LANGUAGE CPP, TemplateHaskell #-}
module Main where
#if __GLASGOW_HASKELL__ >= 610
import Control.Category
import Prelude hiding ((.), init, exp)
#else
import Prelude hiding (init, exp)
#endif
import Control.Arrow
import Control.CCA
import Control.CCA.CCNF
import Control.CCA.Types
import System.IO
import System.... | santolucito/Euterpea_Projects | CCA_main_tests.hs | mit | 3,856 | 2 | 22 | 1,227 | 2,087 | 1,061 | 1,026 | 102 | 2 |
module Data.String.Utils where
rtrim :: String -> String -> String
rtrim chars inp = rtrim' inp
where
rtrim' "" = []
rtrim' [x] = if x `elem` chars then [] else [x]
rtrim' (x:xs) = let tail = rtrim' xs
in
case tail of
[] -> if x `elem` ... | spockz/lhs2texhl | src/Data/String/Utils.hs | mit | 658 | 0 | 13 | 332 | 220 | 119 | 101 | 16 | 6 |
{-# LANGUAGE CPP,
GADTs,
ScopedTypeVariables,
ImpredicativeTypes,
OverloadedStrings
#-}
module Compiler.GhcjsHooks where
import Prelude
import CorePrep (corePrepPgm)
import CoreToStg (coreToStg)
import DriverPip... | ghcjs/ghcjs | src/Compiler/GhcjsHooks.hs | mit | 11,124 | 0 | 17 | 4,079 | 2,077 | 1,071 | 1,006 | 201 | 6 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}
module Eurocode5.Wood.WoodCommon where
data WoodCat = SoftWood | HardWood | PVeneer deriving (Eq,Show)
data Wood =
Wood {
t :: Double, -- ^ Thickness [mm]
rho :: Double, -- ^ Karakteristisk densitet [kg/m3]... | baalbek/eurocode5 | src/Eurocode5/Wood/WoodCommon.hs | gpl-2.0 | 606 | 0 | 8 | 144 | 164 | 90 | 74 | 17 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module Machine.Acceptor.Type2 where
-- $Id$
import Language.Sampler
import Autolib.Informed
import Autolib.ToDoc
import Autolib.Reader
import qualified Autolib.Reporter.Checker as C
import Autolib.Reporter hiding ( output )
import Machine.Class
import Inter.Types ( ScoringOrder (... | florianpilz/autotool | src/Machine/Acceptor/Type2.hs | gpl-2.0 | 1,375 | 2 | 9 | 324 | 375 | 214 | 161 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Mode.Interactive
-- License : GPL-2
-- Maintainer : yi-devel@googlegroups.com
-- Stability : experimental
-- Portability : portable
--
-- Collection of 'Mode's for working with Haskell.
module Yi.Mode.Inter... | atsukotakahashi/wi | src/library/Yi/Mode/Interactive.hs | gpl-2.0 | 4,261 | 0 | 16 | 1,071 | 1,054 | 534 | 520 | 100 | 2 |
{-# LANGUAGE BangPatterns #-}
module CN2D
where
import Data.Array.Base
import CNTypes
import CNBase
import Coupling
import ValueMatrix
import Tridiag
-- import Vector
import Data.Complex
import Control.Applicative
import Control.Arrow
import Control.DeepSeq.Generics
sndDiffKarthDx,sndDiffKarthDy :: (RealFloat a) => ... | KiNaudiz/bachelor | CN/CN2D.hs | gpl-3.0 | 4,482 | 0 | 17 | 1,644 | 1,715 | 905 | 810 | 97 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE TemplateHaskell #-}
module RenderGL where
import qualified Language.Haskell.TH.Lift as THL
import Instances.TH.Lift ()
import Foreign.C.Types (CFloat, CDouble)
import Prelude hiding (sequence)
import Data.Word
import Control.Arrow
import Control.Monad (replicateM)
i... | hesiod/xenocrat | src/exec/RenderGL.hs | gpl-3.0 | 2,226 | 0 | 12 | 571 | 730 | 418 | 312 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
module Homework where
import Control.Monad.Except
data ListIndexError =
ErrTooLargeIndex Int
| ErrNegativeIndex
| OtherErr String
deriving (Eq, Show)
infixl 9 !!!
(!!!) :: (MonadError ListIndexError m) => [a] -> Int -> m a
xs !!! n | n < 0 = throwError ErrNegativeIndex
... | ItsLastDay/academic_university_2016-2018 | subjects/Haskell/11/homework.hs | gpl-3.0 | 537 | 0 | 10 | 143 | 194 | 99 | 95 | 15 | 2 |
{-
CC_Clones - Classic games reimplemented
© Callum Lowcay 2006-2011
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
(at your option) any later version.
This prog... | CLowcay/CC_Clones | src/Common/Util.hs | gpl-3.0 | 2,158 | 3 | 13 | 442 | 684 | 356 | 328 | 42 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Teachers/Get.hs | mpl-2.0 | 6,643 | 0 | 20 | 1,633 | 952 | 557 | 395 | 136 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AdvertiserGroups/Delete.hs | mpl-2.0 | 3,375 | 0 | 14 | 752 | 425 | 251 | 174 | 63 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-iam/gen/Network/AWS/IAM/DeleteUserPolicy.hs | mpl-2.0 | 3,776 | 0 | 9 | 738 | 446 | 273 | 173 | 62 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.AndroidEnterprise
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mo... | rueshyna/gogol | gogol-android-enterprise/gen/Network/Google/AndroidEnterprise.hs | mpl-2.0 | 29,510 | 0 | 80 | 5,356 | 2,901 | 2,118 | 783 | 553 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
-- Module : Text.EDE.Internal.AST
-- Copyright : (c) 2013-2015 Brendan Hay <brendan.g.hay@gmail.com>
-- License : This Source Code Form is subject to the terms of
-- the Mozilla Public License, v. 2.0.
-- A cop... | brendanhay/ede | src/Text/EDE/Internal/AST.hs | mpl-2.0 | 2,101 | 0 | 13 | 546 | 926 | 483 | 443 | 45 | 1 |
-- |
-- Copyright : (c) 2008 Mathieu Boespflug
-- License : LGPL
-- Maintainer : mboes@tweag.net
-- Stability : experimental
-- Portability : non-portable
--
-- This module reexports most of the modules in the vCard library in
-- additionto the mime-directory library, with the exception of
-- |Text.VCard.Query... | mboes/vCard | Text/VCard.hs | lgpl-3.0 | 786 | 0 | 5 | 126 | 62 | 48 | 14 | 5 | 0 |
-- | Module for discrete fuzzy sets.
module Akarui.MVL.FuzzySet
( FuzzySet(..)
, fromSet
, subsetOf
, elementOf
, size
, cardinality
, support
, supportSize
, singleton
, union
, intersection
, complement
, remove0s
) where
import qualified Data.Map.Strict as Map
import Data.Map (Map)
import qualified Data... | PhDP/Manticore | Akarui/MVL/FuzzySet.hs | apache-2.0 | 2,955 | 0 | 14 | 600 | 1,057 | 558 | 499 | 59 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-- |
-- SAML Protocols
--
-- <https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf saml-core-2.0-os> §3
module SAML2.Core.Protocols... | dylex/hsaml2 | SAML2/Core/Protocols.hs | apache-2.0 | 29,388 | 0 | 21 | 5,245 | 7,004 | 3,784 | 3,220 | 664 | 1 |
{-# LANGUAGE QuasiQuotes #-}
-----------------------------------------------------------------------------
--
-- Module : Model.PaperReader.NatureA
-- Copyright :
-- License : BSD3
--
-- Maintainer : Hiro Kai
-- Stability : Experimental
-- Portability :
--
-- |
--
------------------------------------... | hirokai/PaperServer | Parser/Publisher/NatureA.hs | bsd-2-clause | 4,958 | 0 | 16 | 1,178 | 1,666 | 861 | 805 | 88 | 3 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANG... | mikusp/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen/Base.hs | bsd-3-clause | 17,171 | 0 | 16 | 4,770 | 4,928 | 2,793 | 2,135 | 271 | 4 |
module Main where
import Network.Salvia.Handler.ColorLog
import Network.Salvia.Handlers
import Network.Salvia.Impl.Server
import Network.Salvia.Impl.Config
import Network.Salvia.Interface
import System.IO
main :: IO ()
main =
start
defaultConfig
-- This echoes the (parsed) query paramaters.
(hDefaultEnv (do... | sebastiaanvisser/salvia-demo | src/QueryParams.hs | bsd-3-clause | 419 | 0 | 13 | 93 | 101 | 57 | 44 | 15 | 1 |
module Levenshtein where
matchPattern (x:xs) (y:ys) =
(x == y, map (== x) ys, map (== y) xs) : matchPattern xs ys
matchPattern _ _ = []
updateCosts (c1:c2:cs) (match:ms) cost =
let upperCost = if match
then c1
else c2 + 1
newCost = min cost upperCost
in ... | cullina/Extractor | src/Levenshtein.hs | bsd-3-clause | 1,927 | 0 | 11 | 609 | 665 | 347 | 318 | 40 | 3 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- {-# LANGUAGE FlexibleInstances #-}
-- Copyright (c) 2009, Diego Souza
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of s... | dgvncsz0f/hoauth | src/main/haskell/Network/OAuth/Http/CurlHttpClient.hs | bsd-3-clause | 5,589 | 1 | 20 | 2,178 | 756 | 418 | 338 | 58 | 0 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveGeneric #-}
module Main ( main ) where
import GHC.Generics ( Generic )
import GenArgs
data MyArgs f =
MyArgs
{ myInt :: f Int
, myBool :: f Bool
, myString :: f String
} deriving Generic
instance ToFlags MyArgs
instance Show... | ghorn/cmdargs-generic | examples/Main.hs | bsd-3-clause | 1,048 | 0 | 9 | 309 | 338 | 195 | 143 | 45 | 1 |
{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-}
import System.IO
import System.Console.CmdArgs
import ParserTester
import Llvm.Pass.Optimizer ()
import qualified Llvm.Pass.Mem2Reg as M2R ()
import qualified Llvm.Pass.Liveness as L ()
import qualified Llvm.Hir.Data as I
import qualified Llvm.Asm as A
impor... | sanjoy/hLLVM | src/LlvmTest.hs | bsd-3-clause | 15,112 | 0 | 33 | 7,489 | 3,025 | 1,574 | 1,451 | 217 | 14 |
{-# LANGUAGE RecordWildCards #-}
module Grep(runGrep) where
import Language.Haskell.HLint2
import HSE.All
import Control.Monad
import Data.List
import Util
import Idea
runGrep :: String -> ParseFlags -> [FilePath] -> IO ()
runGrep pattern flags files = do
exp <- case parseExp pattern of
ParseOk x -> ret... | bergmark/hlint | src/Grep.hs | bsd-3-clause | 1,165 | 0 | 20 | 360 | 404 | 206 | 198 | 26 | 5 |
module Model.Browse
( BrowseByLink(..)
, SortBy(..)
) where
import Import
data BrowseByLink
= BrowseByAuthorLink
| BrowseByCollectionLink
| BrowseByResourceLink
| BrowseByTagLink
| BrowseByTypeLink
deriving Eq
data SortBy
= SortByAZ
| SortByCountUp -- lowest count at top... | duplode/dohaskell | src/Model/Browse.hs | bsd-3-clause | 688 | 0 | 6 | 185 | 121 | 73 | 48 | 24 | 0 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ExistentialQuantification #-}
module Data.Graph.DAG
( module Data.Graph.DAG.Edge
, module Data.Graph.DAG.Edge.Utils
, module Data.Graph.DAG.Node
, DAG (.... | athanclark/dag | src/Data/Graph/DAG.hs | bsd-3-clause | 1,472 | 0 | 10 | 361 | 420 | 231 | 189 | 31 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module Mantle.Interface where
import Control.Monad.Writer
import qualified Data.Map as M
import Mantle.RTL
imp... | aninhumer/mantle | src/Mantle/Interface.hs | bsd-3-clause | 3,600 | 0 | 12 | 918 | 1,525 | 775 | 750 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.