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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
import System.Plugins
import API
conf = "../Plugin.in"
stub = "../Plugin.stub"
main = do
status <- makeWith conf stub ["-i../api", "-i../../../../src/altdata"]
o <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess _ o -> return o
... | abuiles/turbinado-blog | tmp/dependencies/hs-plugins-1.3.1/testsuite/dynload/should_fail_3/prog/Main.hs | bsd-3-clause | 565 | 0 | 14 | 214 | 160 | 75 | 85 | 14 | 3 |
{-# LANGUAGE CPP #-}
#if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703
{-# LANGUAGE Safe #-}
#endif
#include "containers.h"
-----------------------------------------------------------------------------
-- |
-- Module : Data.Set
-- Copyright : (c) Daan Leijen 2002
-- License : BSD-style
-- Maintainer ... | iu-parfunc/containers | Data/Set.hs | bsd-3-clause | 3,937 | 0 | 5 | 1,499 | 279 | 211 | 68 | 57 | 0 |
module LayoutIn4 where
--Layout rule applies after 'where','let','do' and 'of'
--In this Example: rename 'ioFun' to 'io'
main = io "hello" where io s= do let k = reverse s
--There is a commet
s <- getLine
let q = (k ++ s)
... | kmate/HaRe | old/testing/renaming/LayoutIn4_TokOut.hs | bsd-3-clause | 389 | 0 | 13 | 192 | 72 | 35 | 37 | 6 | 1 |
x <|> y = y
main :: IO ()
main = do{ putStrLn "foo"; putStrLn "bar" } <|> putStrLn "baz"
| hvr/jhc | regress/tests/0_parse/2_pass/DoInfix.hs | mit | 94 | 0 | 8 | 25 | 49 | 23 | 26 | 3 | 1 |
module PrettyDoc where
import TokenTags
data Layout = Horiz Sep | Vert | HorizOrVert Sep | Fill Sep deriving (Show)
data Sep = Cat | Sep deriving (Show)
nonEmpty Empty = False
nonEmpty d = True
data Doc
= Empty
| Char Char
| Text String
| Attr TokenTag Doc
| Nest Int Doc
| Group Layout [Doc]
deriving (... | forste/haReFork | tools/base/pretty/PrettyDoc.hs | bsd-3-clause | 551 | 0 | 7 | 129 | 118 | 69 | 49 | 14 | 1 |
{-# OPTIONS_GHC -fwarn-unused-pattern-binds #-}
-- Trac #17
module Temp (foo, bar, quux) where
top :: Int
top = 1
foo :: ()
foo = let True = True in ()
bar :: Int -> Int
bar match = 1
quux :: Int
quux = let local = True
in 2
| wxwxwwxxx/ghc | testsuite/tests/rename/should_compile/T17c.hs | bsd-3-clause | 238 | 0 | 8 | 63 | 91 | 51 | 40 | 11 | 1 |
{-# LANGUAGE TemplateHaskell, ForeignFunctionInterface, InterruptibleFFI #-}
module TH_foreign where
import Foreign.Ptr
import Language.Haskell.TH
$(return [ForeignD (ImportF CCall Interruptible "&" (mkName "foo") (AppT (ConT ''Ptr) (ConT ''())))])
-- Should generate the same as this:
foreign import ccall interrupt... | urbanslug/ghc | testsuite/tests/th/TH_foreignInterruptible.hs | bsd-3-clause | 344 | 0 | 17 | 46 | 98 | 52 | 46 | 6 | 0 |
module Extras.Data.String where
indent :: [String] -> [String]
indent = map (" " ++)
| fredmorcos/attic | projects/pet/archive/pet_haskell_modular_1/Extras/Data/String.hs | isc | 87 | 0 | 6 | 16 | 34 | 21 | 13 | 3 | 1 |
module Main where
import Data.List
import Data.Ord
data Item = Item { itemName :: String, itemCost, itemDamage, itemArmor :: Int }
deriving (Show, Read)
main =
do print $ minimumBy (comparing itemCost)
$ filter fight
$ gearOptions
print $ maximumBy (comparing itemCost)
$ fil... | glguy/advent2015 | Day21.hs | isc | 2,042 | 0 | 12 | 712 | 740 | 385 | 355 | 57 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.Navigator
(js_getGamepads, getGamepads, js_webkitGetUserMedia,
webkitGetUserMedia, js_registerProtocolHandler,
registerProtocolHandler, js_isProtocolHandlerRegistered,
isProtocolHand... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/Navigator.hs | mit | 14,541 | 192 | 11 | 2,505 | 2,815 | 1,521 | 1,294 | 217 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances,
UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables,
TypeOperators, TypeSynonymInstances, TypeFamilies #-}
import Prelude hiding (lookup,read,last)
{-
State ref and stack
-}
class Memory m where
data Malloc ::... | vs-team/Papers | Before Giuseppe's PhD/Monads/ObjectiveMonad/MonadicObjects/trunk/Src v2/Objell.hs | mit | 4,397 | 0 | 17 | 1,421 | 2,137 | 1,106 | 1,031 | -1 | -1 |
{-# LANGUAGE CPP #-}
#define DO_NOT_EDIT (doNotEdit __FILE__ __LINE__)
-- | Generates code for HTML tags.
--
module Util.GenerateHtmlCombinators where
import Control.Arrow ((&&&))
import Data.List (sort, sortBy, intersperse, intercalate)
import Data.Ord (comparing)
import System.Directory (createDirectoryIfMissing)
... | ajnsit/haste-markup | src/Util/GenerateHtmlCombinators.hs | mit | 17,568 | 0 | 16 | 4,531 | 3,763 | 2,299 | 1,464 | 356 | 2 |
{-# LANGUAGE DeriveGeneric, TemplateHaskell #-}
module Ffs.Jira
( Issue(..)
, issueKey
, issueURI
, issueFields
, nullIssue
, SearchResults(..)
, issuesStartAt
, issuesMaxResults
, issuesTotal
, issues
, User(..)
, userName
, userDisplayName
, userUrl
, WorkLogItems(..)
, logStartsAt
... | tcsc/ffs | src/Ffs/Jira.hs | mit | 6,733 | 0 | 17 | 1,704 | 1,798 | 975 | 823 | 205 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Network.GDAX.Core
( Endpoint
, AccessKey, SecretKey, Passphrase
, Path, Method
, Gdax
, HasGdax (..)
, HasNetworkManager (..)
, HasRestEndpoint (..)
, HasSocketE... | AndrewRademacher/gdax | lib/Network/GDAX/Core.hs | mit | 6,667 | 0 | 16 | 1,668 | 1,877 | 1,001 | 876 | 157 | 2 |
module Phone (number) where
import Data.Char (isDigit)
number :: String -> Maybe String
number xs
| isValid cleanNumber = Just cleanNumber
| otherwise = Nothing
where
cleanNumber = (stripCountryCode . filter isDigit) xs
stripCountryCode :: String -> String
stripCountryCode xs
| length xs == 11 && head xs... | enolive/exercism | haskell/phone-number/src/Phone.hs | mit | 613 | 0 | 11 | 129 | 213 | 108 | 105 | 17 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
-------------------------------------------
-- |
-- Module : Web.Stripe.Event
-- Copyright : (c) David Johnson, 2014
-- Maintainer : djohnson.m@gmail.com
--... | dmjio/stripe | stripe-core/src/Web/Stripe/Event.hs | mit | 2,849 | 0 | 7 | 911 | 412 | 267 | 145 | -1 | -1 |
module Graphics.Pylon.Binding.Pango.Cairo where
import Graphics.Pylon.Foreign.Pango.Cairo
import Graphics.Pylon.Foreign.Pango.Layout
import Graphics.Pylon.Foreign.Pango.Font
import Graphics.Pylon.Foreign.GObject
import Graphics.Pylon.Foreign.Cairo.Cairo
import Foreign.ForeignPtr
fontMapGetDefault :: IO FontMap
fontMa... | philopon/pylon | Graphics/Pylon/Binding/Pango/Cairo.hs | mit | 841 | 0 | 8 | 117 | 243 | 130 | 113 | 20 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
module WykopUtils where
import WykopTypes
import Control.Monad (liftM)
import Data.Aeson (decode, FromJSON)
import Data.Digest.Pure.MD5 (md5)
import Network.HTTP
import qualified Data.ByteString.Lazy.Internal as BS
import qualified Data.ByteString.Lazy.... | mikusp/hwykop | WykopUtils.hs | mit | 2,063 | 0 | 12 | 533 | 732 | 381 | 351 | 53 | 2 |
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent
import Control.Monad
import Common
main :: IO ()
main = do
void . forkIO $ runHttpsClient httpsPort
putStrLn "HTTPS client thread started."
runHttpServer httpPort
| erikd-ambiata/test-warp-wai | test-warp-wai.hs | mit | 239 | 0 | 8 | 45 | 56 | 27 | 29 | 9 | 1 |
-- Paths in the Grid
-- http://www.codewars.com/kata/56a127b14d9687bba200004d
module Kata.GridPath where
numberOfRoutes :: Int -> Int -> Integer
numberOfRoutes m n = product [succ b .. a + b] `div` product [1 .. a]
where a = fromIntegral (min m n)
b = fromIntegral (max m n)
| gafiatulin/codewars | src/6 kyu/GridPath.hs | mit | 291 | 0 | 9 | 62 | 96 | 52 | 44 | 5 | 1 |
-- |
-- Module : Ez.System.Elf
-- Copyright : (c) Eike Ziller
-- License : MIT
--
-- Stability : experimental
-- Portability : non-portable (ELF - only)
--
-- Running @objdump@ on files and interpreting its output.
module Ez.System.Elf (readRpaths) where
import Ez.System.Internal
import System.P... | e4z9/binutils | Ez/System/Elf.hs | mit | 1,435 | 0 | 10 | 314 | 316 | 167 | 149 | 27 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listener.html
module Stratosphere.Resources.ElasticLoadBalancingV2Listener where
import... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/ElasticLoadBalancingV2Listener.hs | mit | 5,086 | 0 | 15 | 479 | 646 | 371 | 275 | 55 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbcluster.html
module Stratosphere.Resources.NeptuneDBCluster where
import Stratosphere.ResourceImport... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/NeptuneDBCluster.hs | mit | 8,246 | 0 | 14 | 865 | 1,370 | 774 | 596 | 90 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticmapreduce-cluster-scriptbootstrapactionconfig.html
module Stratosphere.ResourceProperties.EMRClusterSc... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/EMRClusterScriptBootstrapActionConfig.hs | mit | 2,327 | 0 | 13 | 213 | 266 | 152 | 114 | 28 | 1 |
module AiVsAi.Util where
import Prelude
import Control.Monad.State
--Take from the end of a list
takeEnd :: Int -> [a] -> [a]
takeEnd n l = reverse $ take n $ reverse l
--Zip, but store the excess in a pair
zipWithLeftover :: [a] -> [b] -> ([(a,b)], [a], [b])
zipWithLeftover la lb = (zipList, fst leftover, snd left... | JoeyEremondi/ai-vs-ai-common | src/AiVsAi/Util.hs | gpl-2.0 | 1,315 | 0 | 12 | 391 | 609 | 320 | 289 | 35 | 1 |
--
--
-- (C) 2011-16 Nicola Bonelli <nicola@pfq.io>
--
-- 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 2 of the License, or
-- (at your option) any later version.
--
-- T... | pfq/PFQ | user/pfq-regression/Haskell/test-bloom.hs | gpl-2.0 | 2,373 | 0 | 17 | 644 | 516 | 255 | 261 | 46 | 2 |
-- Starting in the top left corner of a 2×2 grid, and only being able to move to the right
-- and down, there are exactly 6 routes to the bottom right corner.
-- How many such routes are there through a 20×20 grid?
-- Well this is just combinatorics ...
-- * All paths are 20x20 == 40 long, you have to go right 20 a... | ciderpunx/project_euler_in_haskell | euler015.hs | gpl-2.0 | 882 | 2 | 11 | 215 | 104 | 64 | 40 | 7 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- Copyright (c) 2011, 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 source code must retain the above copyright... | dgvncsz0f/tiktok | src/main/TikTok/Plugins/Uptime.hs | gpl-3.0 | 2,510 | 0 | 13 | 542 | 251 | 143 | 108 | 20 | 1 |
module WorkingFluid where
import Utility
import Numeric.Units.Dimensional.Prelude
import qualified Prelude
data GasData = GasData {
condition :: GasCond,
model :: GasModel
}
data GasCond = GasCond {
pressure :: Pre... | taktoa/ThermoCalc | src/WorkingFluid.hs | gpl-3.0 | 3,774 | 0 | 13 | 1,199 | 1,565 | 835 | 730 | 70 | 1 |
-- Vigenere.hs This module provides all of the functions used to
-- encrypt/decrypt/crypanalyize the Vigenere cipher
--
-- Author: Brendan Fahy <brendan@f4hy.com>
-----------------------------------------------------------------------
-- This program is free software: you can redistribute it and/or
-- modify it under t... | f4hy/Vigenery | Vigenere.hs | gpl-3.0 | 5,158 | 1 | 13 | 1,183 | 1,329 | 722 | 607 | 68 | 1 |
{- |
Module : $Header$
Description : Module for factorising numbers using Lenstra's ECM algorithm
Copyright : (c) Michal Parusinski
License : GPLv3
Maintainer : mparusinski@gmail.com
Stability : experimental
Portability : portable
-}
module Factoring.Lenstra where
import EllipticCurves.ModularEl... | mparusinski/Haskell-number-theory-library | Factoring/Lenstra.hs | gpl-3.0 | 5,141 | 0 | 14 | 1,620 | 1,483 | 739 | 744 | 95 | 5 |
-- 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/Grid/Output.hs | gpl-3.0 | 5,672 | 0 | 14 | 1,770 | 1,520 | 801 | 719 | 97 | 1 |
module Inquire (
PrologInquireBoolForm(..),
inquirePrologBool
)
where
import Import hiding(Form)
import CCGraph
import Form
import ShowText
import Control.Monad.CC.CCCxe
import Language.Prolog2.Syntax
import Authentication
import qualified Data.Text as T
breadcrumbWidget :: CCState -> Widget
breadcrumbWidge... | nishiuramakoto/logiku | app/Inquire.hs | gpl-3.0 | 2,410 | 0 | 11 | 664 | 526 | 278 | 248 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import qualified Data.ByteString.Lazy as BL
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import Test.HUnit
import Test.QuickCheck
import qualified Formatter as... | easoncxz/hack-assembler | test/Spec.hs | gpl-3.0 | 2,856 | 0 | 14 | 708 | 711 | 367 | 344 | 97 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionNotificationEndpoints/Get.hs | mpl-2.0 | 4,380 | 0 | 16 | 970 | 466 | 278 | 188 | 82 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/TagKeys/Patch.hs | mpl-2.0 | 5,801 | 0 | 18 | 1,364 | 939 | 546 | 393 | 132 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Actions.Responses
( url
, infoResponse
, errorResponse
, logInResponse
) where
import Text.Blaze.Html5 (Html,(!))
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
import Web.Scotty (RoutePattern)
import App (Action)
import qu... | DataStewardshipPortal/ds-wizard | DSServer/app/Actions/Responses.hs | apache-2.0 | 935 | 0 | 14 | 167 | 277 | 154 | 123 | 28 | 2 |
module Synthax.Algebra
( Algebra
, MAlgebra
, Fix(..)
, LazyFix(..)
, cata
, lazyCata
, mcata
, lazyMCata
) where
import Prelude
type Algebra f a = f a -> a
type MAlgebra m f a = f (m a) -> m a
newtype Fix f = Fx (f (Fix f))
newtype LazyFix f = Fx' (f (LazyFix f) (LazyFix f))
unFix :: Fix f -> f (Fix f)
unFix (Fx x... | burz/sonada | Synthax/Algebra.hs | apache-2.0 | 870 | 0 | 11 | 203 | 481 | 246 | 235 | 26 | 1 |
{-# LANGUAGE CPP, OverloadedStrings, FlexibleContexts #-}
module SSync.Hash (
forName
, name
, HashAlgorithm(..)
, HashState
, HashT
, withHashT
, initState
, update
, digest
, digestSize
, updateS
, digestS
, digestSizeS
, hexString
, withHashState
, withHashState'
) where
import Control.Monad (liftM)
import Contr... | socrata-platform/ssync | src/main/haskell/SSync/Hash.hs | apache-2.0 | 5,282 | 0 | 17 | 1,321 | 1,110 | 596 | 514 | 93 | 5 |
-- | Application entry point
{-# LANGUAGE RecordWildCards #-}
module Main where
import Configuration
import Data.Configurator (Worth (..), load)
import Data.Mongo
import Database.MongoDB
import Web.Routing
main :: IO ()
main = do
conf <- load [Required "app.config... | khanage/mongoweb | Main.hs | apache-2.0 | 1,037 | 0 | 18 | 264 | 256 | 122 | 134 | 27 | 1 |
module Propellor.Property.Grub where
import Propellor.Base
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt
-- | Eg, \"hd0,0\" or \"xen/xvda1\"
type GrubDevice = String
-- | Eg, \"\/dev/sda\"
type OSDevice = String
type TimeoutSecs = Int
-- | Types of machines that gr... | ArchiveTeam/glowing-computing-machine | src/Propellor/Property/Grub.hs | bsd-2-clause | 2,871 | 18 | 13 | 491 | 494 | 287 | 207 | 47 | 5 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Twitter.Conduit
import Common
import Data.Conduit
import qualified Data.Conduit.List as CL
import qualified Data.Map as M
import System.Environment
main :: IO ()
main = do
[screenName] <- getArgs
twInfo <- getTWInfoFromEnv
mgr <- newManager ... | Javran/twitter-conduit | sample/oslist.hs | bsd-2-clause | 812 | 0 | 14 | 174 | 260 | 131 | 129 | 23 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QHostInfo.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:36
Warning : this file is machine generated - do not... | keera-studios/hsQt | Qtc/Enums/Network/QHostInfo.hs | bsd-2-clause | 2,509 | 0 | 18 | 535 | 612 | 310 | 302 | 55 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Util.NamedWindows
-- Description : Associate the X titles of windows with them.
-- Copyright : (c) David Roundy <droundy@darcs.net>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : none
-- Stab... | xmonad/xmonad-contrib | XMonad/Util/NamedWindows.hs | bsd-3-clause | 2,644 | 0 | 16 | 807 | 630 | 343 | 287 | 44 | 1 |
module Inter where
class Functor' f where
fmap' :: (a -> b) -> f a -> f b
-- | tests how to do fmap
-- >>> fmap' (3*) [1,2,3]
-- [3,6,9]
-- Relative Difficulty: 1
instance Functor' [] where
fmap' f [] = []
fmap' f (x:xs) = f x : fmap' f xs
-- | test: maybe for fmap'
-- >>> fmap' (3+) (Just 3)
-- Just 6
-- Ex... | halarnold2000/morris-exercises | src/Inter.hs | bsd-3-clause | 4,752 | 0 | 15 | 1,245 | 1,728 | 914 | 814 | 82 | 1 |
{-# LANGUAGE OverloadedStrings, FlexibleInstances #-}
import System.Environment(getArgs)
import Network
import Control.Monad
import System.IO(Handle, hFlush, hPutChar)
import Data.Aeson
import qualified Data.Aeson.Generic as GJ
import Data.Maybe
import Data.Data
import Data.Typeable
import qualified Data.ByteString.La... | raimohanska/huskybot | src/Main.hs | bsd-3-clause | 1,556 | 0 | 20 | 329 | 542 | 272 | 270 | 43 | 2 |
{-# Language OverloadedStrings #-}
{-# Language FlexibleContexts #-}
module Hooks.PlusOne where
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Hooks.Algebra
import Network.IRC
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as LBS... | MasseR/FreeIrc | src/Hooks/PlusOne.hs | bsd-3-clause | 880 | 0 | 16 | 141 | 280 | 161 | 119 | 25 | 3 |
{-# LANGUAGE BangPatterns, CPP #-}
module Language.Haskell.GhcMod.Logger (
withLogger
, checkErrorPrefix
) where
import Bag (Bag, bagToList)
import Control.Applicative ((<$>),(*>))
import CoreMonad (liftIO)
import Data.IORef (IORef, newIORef, readIORef, writeIORef, modifyIORef)
import Data.List (isPrefixOf)
i... | darthdeus/ghc-mod-ng | Language/Haskell/GhcMod/Logger.hs | bsd-3-clause | 3,676 | 0 | 17 | 670 | 1,058 | 564 | 494 | 71 | 1 |
{-|
Module : Idris.Coverage
Description : Clause generation for coverage checking
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE FlexibleContexts, PatternGuards #-}
module Idris.Coverage(genClauses, validCoverageCase, recoverableCoverage,
mkPatTm) where
i... | uuhan/Idris-dev | src/Idris/Coverage.hs | bsd-3-clause | 19,812 | 0 | 17 | 6,418 | 7,133 | 3,550 | 3,583 | 367 | 22 |
{-# LANGUAGE OverloadedStrings #-}
module Article.DataSource.Article
(
createArticle
, getArticle
, removeArticle
, getArticleIdList
, countArticle
, updateArticle
, updateArticleCover
, updateArticleExtra
, updateArticleTitle
, updateArticleSummary
, updateArticleContent
, existsArticle
... | Lupino/dispatch-article | src/Article/DataSource/Article.hs | bsd-3-clause | 4,985 | 0 | 14 | 1,321 | 1,322 | 717 | 605 | 92 | 3 |
module Properties.Failure where
import XMonad.StackSet hiding (filter)
import qualified Control.Exception as C
import System.IO.Unsafe
import Data.List (isPrefixOf)
-- ---------------------------------------------------------------------
-- testing for failure and help out hpc
--
-- Since base 4.9.0.0 `error` append... | xmonad/xmonad | tests/Properties/Failure.hs | bsd-3-clause | 1,001 | 0 | 10 | 178 | 200 | 113 | 87 | 14 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Database.PostgreSQL.Schedule where
import Control.Concurrent (forkIO)
import Data.Aeson (toJSON, ToJSON, Value)
import Data.AffineSpace ((.-.))
import Data.Text (Text)
import qualified Data.Text as T
import ... | noteed/humming | Database/PostgreSQL/Schedule.hs | bsd-3-clause | 7,340 | 0 | 25 | 1,591 | 1,527 | 783 | 744 | 129 | 4 |
{-|
Module : Database.Relational.Into
Description : Definition of INTO.
Copyright : (c) Alexander Vieth, 2015
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE AutoDeriveTypeable #-}
module Database.Relational.Into (
INTO(... | avieth/Relational | Database/Relational/Into.hs | bsd-3-clause | 365 | 0 | 6 | 75 | 28 | 19 | 9 | 4 | 0 |
{- |
Module : SAWScript.Crucible.Common.MethodSpec
Description : Language-neutral method specifications
License : BSD3
Maintainer : langston
Stability : provisional
This module uses GADTs & type families to distinguish syntax-extension- (source
language-) specific code. This technique is described in the p... | GaloisInc/saw-script | src/SAWScript/Crucible/Common/MethodSpec.hs | bsd-3-clause | 15,087 | 0 | 17 | 3,402 | 3,577 | 1,890 | 1,687 | 283 | 12 |
-- Copyright 2013 Kevin Backhouse.
{-|
This example is a variation on the
'Control.Monad.MultiPass.Example.Assembler.assembler' example. It
illustrates how one might convert a control flow graph into a linear
sequence of instructions. The example is less complete than the
'Control.Monad.MultiPass.Example.Assembler.as... | kevinbackhouse/Control-Monad-MultiPass | src/Control/Monad/MultiPass/Example/CFG.hs | bsd-3-clause | 3,435 | 0 | 17 | 802 | 1,095 | 562 | 533 | -1 | -1 |
module ElmFormat.Render.ElmStructureTest where
import Elm.Utils ((|>))
import Test.Tasty
import Test.Tasty.HUnit
import qualified Data.Text.Lazy as LazyText
import qualified Data.Text as Text
import AST.V0_16
import Box
import ElmFormat.Render.ElmStructure
trim :: String -> String
trim text =
text
|> L... | nukisman/elm-format-short | tests/ElmFormat/Render/ElmStructureTest.hs | bsd-3-clause | 2,499 | 0 | 12 | 867 | 663 | 342 | 321 | 71 | 1 |
module Rubik.D2 where
import Data.Ix
import Rubik.Negate as N
import Rubik.Axis as V
import Rubik.Turn as T
import Rubik.Key as K
-- http://en.wikipedia.org/wiki/Cartesian_coordinate_system
data D2 = X | Y
deriving (Eq,Ord,Show,Enum,Ix)
instance Key D2 where
universe = [ X, Y ]
-- (clockwise) turn
turnD... | andygill/rubik-solver | src/Rubik/D2.hs | bsd-3-clause | 669 | 0 | 12 | 135 | 232 | 126 | 106 | 17 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
module HVX
( Var
, Vars
, Vex(..)
, Mon(..)
-- * Constructors for supported primitives.
, Expr(EConst, EVar)
, hadd
, (+~)
, hmul
, (*~)
, habs
, neg
, hlog
, hexp
, logsumexp
, hmax
, hmin
, norm
, berhu
, huber
, quadform
,... | chrisnc/hvx | src/HVX.hs | bsd-3-clause | 997 | 0 | 5 | 234 | 190 | 133 | 57 | 52 | 0 |
{-# LANGUAGE RecordWildCards #-}
-- | read/write ImpulseTracker files
module Codec.Tracker.IT (
Module(..)
, getModule
, putModule
) where
import Control.Monad
import Data.Binary
import Data.Binary.Get
import Data.Binary.Put
import Codec.Tracker.IT.... | riottracker/modfile | src/Codec/Tracker/IT.hs | bsd-3-clause | 2,534 | 0 | 15 | 747 | 700 | 359 | 341 | 50 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main(main) where
import Dirs(funName)
import Goal(simplifyE)
import SolutionMap (saveAxiomaticFunSolution)
import StorageBackend(localStorage, localSharedStorage
, disableRead, disableWrite)
import Theory(Name,Expr,parse)
i... | GaloisInc/verification-game | web-prover/exes/SetPrePost.hs | bsd-3-clause | 1,724 | 0 | 15 | 462 | 476 | 250 | 226 | 46 | 2 |
module LispVector
( makeVector
, vector
, vectorSet
, vectorLength
, vectorRef
, vectorToList
, vectorFill
) where
import Data.Array.IArray
import Definition
-- size must be >= 0
makeVector :: Int -> a -> SVector a
makeVector size val =
let (low, high) = getLVecBounds size
in array (low, high) ... | comraq/scheme-interpreter | src/LispVector.hs | bsd-3-clause | 877 | 0 | 10 | 193 | 348 | 186 | 162 | 30 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
module Language.Inferno.TRef (TRef,
newTRef,
readTRef,
TransM,
... | sweirich/hs-inferno | src/Language/Inferno/Generic/TRef.hs | bsd-3-clause | 2,634 | 0 | 15 | 691 | 835 | 418 | 417 | 67 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module Chess.Move.Generator
( -- * Legality checks
PseudoLegalMove
, Legality
, mkPseudo
, mkLegality
, legalCheck
, capturedPiece'
, from'
, to'
-- * Generators
, moves
, forcingMoves
, anyMo... | phaul/chess | Chess/Move/Generator.hs | bsd-3-clause | 21,658 | 0 | 20 | 5,061 | 5,725 | 2,968 | 2,757 | 387 | 5 |
module ImageQuery.Parser where
import ImageQuery (
ImageQueryStatement(SetImageQueryParameter,GetImageQueryResult),
ImageQueryParameter(Threshold,Channel,Smoothing,SubRect,StencilImage,Polarity),
ImageQuery(TableQuery,IslandImage,ImageOfAverage,LineImage,AreaHistogram),
TableQuery(ValueInPoint,AverageA... | phischu/pem-images | src/ImageQuery/Parser.hs | bsd-3-clause | 5,470 | 0 | 14 | 912 | 1,410 | 721 | 689 | 157 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Crawl.BadForms where
import Data.List (find)
import qualified Data.HashMap.Strict as H
import Crawl.Move
import Crawl.Status
data Form = Normal | Tree | Fungus | Spider | Pig | Wisp
filterLegalInForm :: Player -> Maybe Move -> Maybe Move
filterLegalInForm p (Just (Go _ _)... | rwbarton/rw | Crawl/BadForms.hs | bsd-3-clause | 1,353 | 0 | 12 | 289 | 624 | 337 | 287 | 38 | 19 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
module Network.BitTorrent.Client
( -- * Options
Options (..)
-- * Client session
, Client
-- ** Sessi... | pxqr/bittorrent | src/Network/BitTorrent/Client.hs | bsd-3-clause | 5,518 | 1 | 13 | 1,341 | 1,233 | 683 | 550 | -1 | -1 |
{-# LANGUAGE NamedFieldPuns, TupleSections #-}
module Distribution where
import Data.List ( intercalate )
import Data.Map ( Map )
import qualified Data.Map as Map
import Data.Monoid ( (<>) )
import Data.Set ( Set )
import qualified Data.Set as Set
data Dist... | cblp/ruhaskell-meetup-reg-form-stats | src/Distribution.hs | bsd-3-clause | 1,225 | 0 | 16 | 394 | 404 | 221 | 183 | -1 | -1 |
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE RecordWildCards #-}
-- | Functionality related to 'Address' data type and related types.
module Pos.Core.Common.Address
( Address (..)
, Address' (..)
-- * Formatting
, addressF
, addressDetailedF
, decodeTextAddress
... | input-output-hk/pos-haskell-prototype | core/src/Pos/Core/Common/Address.hs | mit | 18,978 | 0 | 14 | 4,048 | 3,139 | 1,761 | 1,378 | -1 | -1 |
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.DHT.DhtPacketSpec where
import Test.Hspec
import Test.QuickCheck
import Data.Binary (Binary)
import qualified Data.Binary as Binary (get, put)
import qualified Data.Binary.Get... | iphydf/hs-toxcore | test/Network/Tox/DHT/DhtPacketSpec.hs | gpl-3.0 | 3,143 | 0 | 12 | 644 | 861 | 493 | 368 | 56 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-lambda/gen/Network/AWS/Lambda/GetEventSourceMapping.hs | mpl-2.0 | 7,299 | 0 | 23 | 1,553 | 993 | 586 | 407 | 106 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/StartInstance.hs | mpl-2.0 | 3,361 | 0 | 9 | 680 | 360 | 221 | 139 | 48 | 1 |
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------
--
-- Stg to C--: primitive operations
--
-- (c) The University of Glasgow 2004-2006
--
-----------------------------------------------------------------------------
module StgCmmPrim (
cgOpApp,
cgPrimOp, -- intern... | acowley/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | 96,640 | 3 | 21 | 25,780 | 24,918 | 12,461 | 12,457 | -1 | -1 |
{-# LANGUAGE BangPatterns #-}
-- | This module defines a type for mutable, string-valued labels.
-- Labels are variable values and can be used to track e.g. the
-- command line arguments or other free-form values. All operations on
-- labels are thread-safe.
module System.Remote.Label
(
Label
, set
, ... | ekmett/ekg | System/Remote/Label.hs | bsd-3-clause | 806 | 0 | 14 | 178 | 201 | 111 | 90 | 15 | 1 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude
, DeriveDataTypeable
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Stable
-- Copyright : (c) The Universit... | alexander-at-github/eta | libraries/base/GHC/Stable.hs | bsd-3-clause | 3,905 | 5 | 11 | 719 | 395 | 233 | 162 | -1 | -1 |
{-# LANGUAGE PatternGuards, TemplateHaskell, QuasiQuotes #-}
-- |
-- Module : Language.C.Inline.ObjC.Marshal
-- Copyright : [2013] Manuel M T Chakravarty
-- License : BSD3
--
-- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au>
-- Stability : experimental
-- Portability : non-portable (GHC exten... | beni55/language-c-inline | Language/C/Inline/ObjC/Marshal.hs | bsd-3-clause | 19,242 | 14 | 20 | 7,391 | 3,663 | 2,174 | 1,489 | 289 | 8 |
-- | We create a file <root>/test/ghcconfig containing configuration of test
-- | compiler. We need to search this file for required keys and setting
-- | required for testsuite e.g. WORDSIZE, HOSTOS etc.
module Oracles.TestSettings (TestSetting (..), testSetting, testRTSSettings) where
import Base
import Hadrian.Ora... | snowleopard/shaking-up-ghc | src/Oracles/TestSettings.hs | bsd-3-clause | 2,784 | 0 | 10 | 984 | 334 | 186 | 148 | 56 | 21 |
{- |
Description : logic for first order provers like SPASS
This folder contains the interface to the SoftFOL provers. Currently there are
three prover interfaces available: SPASS, the MathServ Broker and Vampire
whereas the latter is called via MathServ, too. The MathServ Broker chooses
the best prover depending on ... | keithodulaigh/Hets | SoftFOL.hs | gpl-2.0 | 2,959 | 0 | 2 | 378 | 5 | 4 | 1 | 1 | 0 |
<?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="de-DE">
<title>Regular Expression Tester</title>
<maps>
<homeID>regextester</homeID>
<m... | kingthorin/zap-extensions | addOns/regextester/src/main/javahelp/help_de_DE/helpset_de_DE.hs | apache-2.0 | 978 | 77 | 66 | 157 | 409 | 207 | 202 | -1 | -1 |
{-# OPTIONS -cpp #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Set60204 where
#if __GLASGOW_HASKELL__ >= 604
import qualified Data.Set as S
differenceS = S.difference
unionsS = S.unions
intersectionS = S.intersection
fromListS = S.fromList
emptyS = S.empty
memberS = S.member
mapS = S.map
elemsS = S.elems
uni... | kmate/HaRe | old/tools/base/Set60204.hs | bsd-3-clause | 566 | 0 | 5 | 82 | 80 | 50 | 30 | 13 | 1 |
{-# LANGUAGE AllowAmbiguousTypes, TypeFamilies #-}
module ContextStack2 where
type family TF a :: *
type instance TF (a,b) = (TF a, TF b)
t :: (a ~ TF (a,Int)) => Int
t = undefined
| spacekitteh/smcghc | testsuite/tests/typecheck/should_fail/ContextStack2.hs | bsd-3-clause | 184 | 0 | 9 | 37 | 72 | 43 | 29 | 6 | 1 |
{-# LANGUAGE CPP #-}
#include "T12135.h"
main = print message
| olsner/ghc | testsuite/tests/driver/T12135.hs | bsd-3-clause | 62 | 0 | 5 | 10 | 11 | 6 | 5 | 2 | 1 |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... | traceguide/api-php | vendor/apache/thrift/lib/hs/src/Thrift/Protocol/Compact.hs | mit | 10,297 | 0 | 19 | 2,334 | 3,217 | 1,677 | 1,540 | 228 | 13 |
{-# LANGUAGE Safe #-}
-- Since Safe we require base package be trusted to compile
module Check04_B where
import Check04_A
mainM :: Int -> Int
mainM n = trace "Allowed Leak" $ n * 2
| urbanslug/ghc | testsuite/tests/safeHaskell/check/Check04_B.hs | bsd-3-clause | 185 | 0 | 7 | 39 | 37 | 21 | 16 | 5 | 1 |
{-# LANGUAGE Safe #-}
{-# OPTIONS_GHC -fenable-rewrite-rules #-}
-- | Check rules are disabled under Safe
module Main where
data T = T1 | T2 | T3 deriving ( Eq, Ord, Show )
lookupx :: Ord key => Show val => [(key,val)] -> key -> Maybe val
lookupx [] _ = Nothing
lookupx ((t,a):xs) t' | t == t' ... | urbanslug/ghc | testsuite/tests/safeHaskell/safeLanguage/SafeLang05.hs | bsd-3-clause | 1,036 | 0 | 14 | 332 | 412 | 210 | 202 | -1 | -1 |
module ShouldFail where
class A a where
p1 :: a -> a
p2 :: a -> a -> a
class (A b) => B b where
p3 :: b
p4 :: b -> b
class (A c) => C c where
p5 :: c -> c
p6 :: c -> Int
class (B d,C d) => D d where
p7 :: d -> d
instance D [a] where
p7 l = []
| hferreiro/replay | testsuite/tests/typecheck/should_fail/tcfail019.hs | bsd-3-clause | 257 | 0 | 8 | 86 | 157 | 83 | 74 | 14 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module ConfigMenu where
-- import Graphics.Vty hiding (pad)
import Graphics.Vty.Widgets.All
-- import System.Locale
-- import Control.Monad
import qualified Data.Text as T
-- Multi-state checkbox value type
data FlowControlType = Hardware | Software deriving (Eq, Show)
-- data Spe... | alterapraxisptyltd/serialterm | src/ConfigMenu.hs | isc | 2,435 | 0 | 17 | 736 | 538 | 276 | 262 | 45 | 1 |
module Main where
import FD
import Sudoku
import Queens2
import SendMoreMoney
testPuzzle :: Puzzle
testPuzzle = [
0, 0, 0, 0, 8, 0, 0, 0, 0,
0, 0, 0, 1, 0, 6, 5, 0, 7,
4, 0, 2, 7, 0, 0, 0, 0, 0,
0, 8, 0, 3, 0, 0, 1, 0, 0,
0, 0, 3, 0, 0, 0, 8, 0, 0,
0, 0, 5, 0, 0, 9, 0, 7, 0,
0, 5, 0, 0, 0,... | dmoverton/finite-domain | app/Main.hs | mit | 1,393 | 0 | 12 | 514 | 887 | 568 | 319 | 49 | 1 |
-- In this class, I can USE the data instance of AnonClass, but I'm not allowed
-- to actually construct it
module Main where
import ClassExample
main :: IO ()
main = printAnon $ anonClass "Hello"
printAnon :: (Show a) => AnonClass a -> IO ()
printAnon = print
| iduhetonas/haskell-projects | DataTypes/ClassTest.hs | mit | 265 | 0 | 8 | 53 | 62 | 34 | 28 | 6 | 1 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Hacking | codeJam/2013/osmos/osmos.hs | mit | 3,141 | 0 | 13 | 889 | 887 | 484 | 403 | 65 | 7 |
{-# LANGUAGE DeriveGeneric #-}
-- | RSA crypto utility functions
--
-- High-level wrapper around the somewhat arcane HsOpenssl library. There are
-- various alternative libraries around, but I don't trust them. I would really
-- like to use libsodium / saltine, but the author specifically advices against
-- us... | solatis/dissent | src/Dissent/Crypto/Rsa.hs | mit | 4,714 | 0 | 14 | 1,043 | 799 | 455 | 344 | 74 | 1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
-- | This module provides a function for reading .xlsx files
module Codec.Xlsx.Parser
( toXlsx
) where
import qualified Codec.Archive.Zip as Zip
import Control.Applicative
import Con... | lookunder/xlsx | src/Codec/Xlsx/Parser.hs | mit | 6,636 | 0 | 19 | 1,769 | 2,097 | 1,090 | 1,007 | 148 | 6 |
{-# LANGUAGE DeriveDataTypeable #-}
module BT.Config where
import Data.Configurator (lookup, Worth(Required), load)
import Data.Configurator.Types (Configured, Config)
import Data.Text (pack)
import Data.Maybe (fromMaybe)
import Data.Typeable (Typeable)
import Control.Exception
data ConfigException = ConfigException... | c00w/BitToll | haskell/BT/Config.hs | mit | 648 | 0 | 11 | 95 | 201 | 109 | 92 | 17 | 1 |
--------------------------------------------------------------------------------
-- Highly divisible triangular number
-- Problem 12
-- The sequence of triangle numbers is generated by adding the natural numbers.
-- So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
-- The first ten terms would be:
... | bertdouglas/euler-haskell | 001-050/12a.hs | mit | 2,046 | 0 | 10 | 519 | 264 | 144 | 120 | 21 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Database.RethinkDB.Model.IO where
import Database.RethinkDB.NoClash
import Control.Monad.Trans.Reader
import Control.Monad.Trans (liftIO)
-- RethinkIO ---------------------------------------------
runDb :: (Expr a, Result r) => a -> RethinkIO r
runDb e = do
h <- ask
... | seanhess/rethinkdb-model | Database/RethinkDB/Model/IO.hs | mit | 385 | 0 | 8 | 61 | 99 | 56 | 43 | 10 | 1 |
{-# LANGUAGE FlexibleInstances #-}
module Model where
import ClassyPrelude.Yesod
import Database.Persist.Quasi
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkP... | KasperJanssens/yesod-tutorial | Model.hs | mit | 711 | 0 | 8 | 117 | 96 | 57 | 39 | -1 | -1 |
module Main where
import Control.Applicative
import Data.Char (digitToInt)
import System.IO (print)
main = print $ maximum $ map sumOfDigits gogol
gogol = (^) <$> [1..100] <*> [1..100]
sumOfDigits = sum . map digitToInt . show
| t00n/ProjectEuler | Euler/Euler56/main.hs | epl-1.0 | 281 | 0 | 7 | 89 | 88 | 50 | 38 | 7 | 1 |
import Math
import Data.List
import Data.Function
-- PROBLEM 85
csrec i j m n = (succ (m - i)) * (succ (n - j))
crec m n = sum [csrec i j m n | i <- [1..m], j <- [1..n]]
sol_85 size lim = minimumBy (compare `on` snd) res
where res = [(i*j, abs (lim - (crec i j))) | i <- [1..size], j <- [1..size]]
-- ELAPSED TIME... | zeniuseducation/poly-euler | haskell/prob76-100.hs | epl-1.0 | 338 | 0 | 13 | 83 | 199 | 107 | 92 | 7 | 1 |
{-# language RankNTypes #-}
{-# language ScopedTypeVariables #-}
{-# language FlexibleContexts #-}
module Machine.Numerical.Make where
import Inter.Types
import Machine.Class
import qualified Machine.Var as M
import qualified Machine.Numerical.Type as N
import qualified Machine.Numerical.Config as Con
import Challe... | marcellussiegburg/autotool | collection/src/Machine/Numerical/Make.hs | gpl-2.0 | 2,421 | 0 | 19 | 863 | 768 | 406 | 362 | 58 | 1 |
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
-- | Korrekturfunktion für Faktorisierung
-- joe@informatik.uni-leipzig.de
-- benutzt code für challenger/PCProblem
-- von Markus Kreuz mai99byv@studserv.uni-leipzig.de
module Faktor.Times (
make_fixed
, make_quiz
) where
... | Erdwolf/autotool-bonn | src/Faktor/Times.hs | gpl-2.0 | 1,860 | 13 | 17 | 448 | 482 | 251 | 231 | 45 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module Algebraic.Relation.Restriction where
import Condition
import Autolib.Reader
import Autolib.ToDoc
import Autolib.Size
import Autolib.Reporter
import Data.Typeable
data Restriction
= Size_Range (Int, Int)
deriving ( Eq, Ord, Typeable )
$(derives [makeReader, makeTo... | florianpilz/autotool | src/Algebraic/Relation/Restriction.hs | gpl-2.0 | 394 | 0 | 9 | 67 | 92 | 55 | 37 | 12 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.