_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
2a5083a9987f1dcaf8419bbe55f7ccf7c9feb596ee64bb7ca0d82697f6557d92 | exercism/haskell | Poker.hs | module Poker (bestHands) where
import Data.Maybe (fromJust)
import Data.List (nub, elemIndex, sortBy)
validHand :: [String] -> Bool
validHand h = and [ length h == 5
, all (`elem` "A23456789TJQK") (head <$> h)
, all (`elem` "HSDC") (last <$> h)
, all ((==2) . len... | null | https://raw.githubusercontent.com/exercism/haskell/ae17e9fc5ca736a228db6dda5e3f3b057fa6f3d0/exercises/practice/poker/.meta/examples/success-standard/src/Poker.hs | haskell | module Poker (bestHands) where
import Data.Maybe (fromJust)
import Data.List (nub, elemIndex, sortBy)
validHand :: [String] -> Bool
validHand h = and [ length h == 5
, all (`elem` "A23456789TJQK") (head <$> h)
, all (`elem` "HSDC") (last <$> h)
, all ((==2) . len... | |
a4c03c1be5d17079d451d7afdfc29d70481068b100578b257bde3bb01bbabfe0 | haskell-suite/haskell-src-exts | SimpleDeriving.hs | data T = T deriving Eq
| null | https://raw.githubusercontent.com/haskell-suite/haskell-src-exts/84a4930e0e5c051b7d9efd20ef7c822d5fc1c33b/tests/examples/SimpleDeriving.hs | haskell | data T = T deriving Eq
| |
013134fe6278fa05554ea138f1324c57a4c00e84fdcf6ad87eac4ad3aeb28bb1 | CRogers/obc | util.ml |
* util.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions of... | null | https://raw.githubusercontent.com/CRogers/obc/49064db244e0c9d2ec2a83420c8d0ee917b54196/compiler/util.ml | ocaml | copy -- list of n copies of a value
Make a hash table
Search a directory path
offset -- add base address and offset |
* util.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions of... |
0037c543595ea58e7022640507f10569f0f17cf9792bd0fa6375576fb749caaf | rbkmoney/fistful-server | ff_identity_SUITE.erl | -module(ff_identity_SUITE).
-export([all/0]).
-export([init_per_suite/1]).
-export([end_per_suite/1]).
-export([init_per_testcase/2]).
-export([end_per_testcase/2]).
-export([get_missing_fails/1]).
-export([create_missing_fails/1]).
-export([create_ok/1]).
%%
-import(ff_pipeline, [unwrap/1]).
-type config() :: ct_... | null | https://raw.githubusercontent.com/rbkmoney/fistful-server/f6155acb0475987e47a4fbc911758c595e129c80/apps/fistful/test/ff_identity_SUITE.erl | erlang | -module(ff_identity_SUITE).
-export([all/0]).
-export([init_per_suite/1]).
-export([end_per_suite/1]).
-export([init_per_testcase/2]).
-export([end_per_testcase/2]).
-export([get_missing_fails/1]).
-export([create_missing_fails/1]).
-export([create_ok/1]).
-import(ff_pipeline, [unwrap/1]).
-type config() :: ct_hel... | |
a3fc0294de6d82cadb61d73d8742e26b6df2f9187e703783fce5be61211b0c4b | JeffreyBenjaminBrown/digraphs-with-text | replaceUsf.hs | replaceUsf :: Node -> Expr -> RSLT -> RSLT
replaceUsf n expr g =
let (Just (a,b,expr',d), g') = match n g
in if areLikeExprs expr expr' then (a,b,expr,d) & g'
else error "unlike Exprs"
| null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/digraphs-with-text/34e47a52aa9abb6fd42028deba1623a92e278aae/stale/Dwt/replaceUsf.hs | haskell | replaceUsf :: Node -> Expr -> RSLT -> RSLT
replaceUsf n expr g =
let (Just (a,b,expr',d), g') = match n g
in if areLikeExprs expr expr' then (a,b,expr,d) & g'
else error "unlike Exprs"
| |
be7535ae395170153db2f0a7243d0982d58389b646026840733d30ae3ee6fbdb | wilkerlucio/tailwind-garden | tables.cljc | (ns com.wsscode.tailwind-garden.components.tables)
(defn border-collapse
"-collapse"
[]
[[:.border-collapse {:border-collapse "collapse"}]
[:.border-separate {:border-collapse "separate"}]])
(defn table-layout
"-layout"
[]
[[:.table-auto {:table-layout "auto"}]
[:.table-fixed {:table-layout "fixed"}... | null | https://raw.githubusercontent.com/wilkerlucio/tailwind-garden/4f8af13165dd997de15b20ac5e7dd06351821acd/src/main/com/wsscode/tailwind_garden/components/tables.cljc | clojure | (ns com.wsscode.tailwind-garden.components.tables)
(defn border-collapse
"-collapse"
[]
[[:.border-collapse {:border-collapse "collapse"}]
[:.border-separate {:border-collapse "separate"}]])
(defn table-layout
"-layout"
[]
[[:.table-auto {:table-layout "auto"}]
[:.table-fixed {:table-layout "fixed"}... | |
bf1c65c12d25802b50b28e9afbf45c2441411672ad2f27d85d82e952d20a9d25 | metabase/metabase | malli.cljs | (ns metabase.domain-entities.malli
(:require
[malli.core :as mc]
[malli.util :as mut]
[metabase.domain-entities.converters])
(:require-macros [metabase.domain-entities.malli]))
(clojure.core/defn schema-for-path
"Given a schema and a *value path* (as opposed to a *schema path*), finds the schema for ... | null | https://raw.githubusercontent.com/metabase/metabase/4580eab946097e9dda36cc0bc0406fc10d5b01cd/src/metabase/domain_entities/malli.cljs | clojure | (ns metabase.domain-entities.malli
(:require
[malli.core :as mc]
[malli.util :as mut]
[metabase.domain-entities.converters])
(:require-macros [metabase.domain-entities.malli]))
(clojure.core/defn schema-for-path
"Given a schema and a *value path* (as opposed to a *schema path*), finds the schema for ... | |
62336c6f9fc22f2ff16026615c3216a82d5aacdad35d2f4ea0a735dc55b183b3 | cicakhq/potato | user.lisp | (in-package :potato-client-clim)
(declaim (optimize (speed 0) (safety 3) (debug 3)))
(defclass user ()
((id :type string
:initarg :id
:reader user/id)
(description :type string
:initarg :description
:accessor user/description)
(nickname ... | null | https://raw.githubusercontent.com/cicakhq/potato/88b6c92dbbc80a6c9552435604f7b1ae6f2a4026/contrib/potato-client-clim/src/user.lisp | lisp | (in-package :potato-client-clim)
(declaim (optimize (speed 0) (safety 3) (debug 3)))
(defclass user ()
((id :type string
:initarg :id
:reader user/id)
(description :type string
:initarg :description
:accessor user/description)
(nickname ... | |
2f1d306ce179aba19a138f2d4d5bfdc99dd5b218feed3871f60f39965097fb13 | processone/stun | stun.erl | %%%-------------------------------------------------------------------
%%% File : stun.erl
Author : < >
Description : / RFC5766 implementation .
Created : 8 Aug 2009 by < >
%%%
%%%
Copyright ( C ) 2002 - 2023 ProcessOne , SARL . All Rights Reserved .
%%%
Licensed under the Apache License , Versi... | null | https://raw.githubusercontent.com/processone/stun/5e41e347d97da0f68182a0870af806354996ab99/src/stun.erl | erlang | -------------------------------------------------------------------
File : stun.erl
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY ... | Author : < >
Description : / RFC5766 implementation .
Created : 8 Aug 2009 by < >
Copyright ( C ) 2002 - 2023 ProcessOne , SARL . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-modu... |
6c5d5a07e3788376b64c4d117f99457f1d88402a1fdaf1181036a3257fdd829b | liquidz/antq | shadow_test.clj | (ns antq.dep.shadow-test
(:require
[antq.dep.shadow :as sut]
[antq.record :as r]
[antq.util.env :as u.env]
[clojure.java.io :as io]
[clojure.test :as t]))
(def ^:private file-path
"path/to/shadow-cljs.edn")
(defn- dependency
[m]
(r/map->Dependency (merge {:project :shadow-cljs
... | null | https://raw.githubusercontent.com/liquidz/antq/51b257d94761a4642c6d35e65774a060248624b7/test/antq/dep/shadow_test.clj | clojure | (ns antq.dep.shadow-test
(:require
[antq.dep.shadow :as sut]
[antq.record :as r]
[antq.util.env :as u.env]
[clojure.java.io :as io]
[clojure.test :as t]))
(def ^:private file-path
"path/to/shadow-cljs.edn")
(defn- dependency
[m]
(r/map->Dependency (merge {:project :shadow-cljs
... | |
a76ba1c53a8f766670428934faa9b5cbf370f2b9b31b56d6700714f3cbe7cc37 | den1k/vimsical | core_test.clj | (ns vimsical.backend.core-test
(:require
[vimsical.backend.core :as sut]
[clojure.test :as t]))
(t/deftest core-test (t/is true))
| null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/test/backend/vimsical/backend/core_test.clj | clojure | (ns vimsical.backend.core-test
(:require
[vimsical.backend.core :as sut]
[clojure.test :as t]))
(t/deftest core-test (t/is true))
| |
85de58182586a5799656947155daf8722e6da268d340bb25b1016793fb0a827b | McMasterU/HashedExpression | OperationSpec.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DuplicateRecordFields #
-- |
Module : HashedExpression . Internal . OperationSpec
-- Copyright : (c) OCA 2020
License : MIT ( see the LICENSE file )
-- Maintainer :
-- Stability : provisional
-- Portability : unportable
--
-- This modules contain... | null | https://raw.githubusercontent.com/McMasterU/HashedExpression/cfe9f21165f1f3fc6d59ec27fb962c29e67a9bbb/src/HashedExpression/Internal/OperationSpec.hs | haskell | |
Copyright : (c) OCA 2020
Maintainer :
Stability : provisional
Portability : unportable
This modules contains specification for all operations (each corresponding to a constructor of @Op)
-----------------------------------------------------------------------------
------------------------------------... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DuplicateRecordFields #
Module : HashedExpression . Internal . OperationSpec
License : MIT ( see the LICENSE file )
module HashedExpression.Internal.OperationSpec where
import Data.Function ((&))
import Data.List (sort)
import GHC.Stack (HasCallStack)
imp... |
5e879159d66feac30dc799b7819cb95dd38ced04e15e77c2cc09929f1a29e2fc | abridgewater/nq-clim | standard-application-frame.lisp | ;;;
nq - clim / frame / standard - application - frame
;;;
;;; The normal superclass for an application frame class.
;;;
(cl:defpackage :nq-clim/frame/standard-application-frame
(:use :cl
:nq-clim/frame/application-frame
:nq-clim/frame/application-frame-functions
:nq-clim/frame/manageable-f... | null | https://raw.githubusercontent.com/abridgewater/nq-clim/11d339fd0ac77b6d624fc5537b170294a191a3de/frame/standard-application-frame.lisp | lisp |
The normal superclass for an application frame class.
| nq - clim / frame / standard - application - frame
(cl:defpackage :nq-clim/frame/standard-application-frame
(:use :cl
:nq-clim/frame/application-frame
:nq-clim/frame/application-frame-functions
:nq-clim/frame/manageable-frame-mixin)
(:export
"STANDARD-APPLICATION-FRAME"))
(cl:in-packag... |
b4cb3020a19c3642d5098b428bdfc06eae19743243c6416c0faeacb1aa6779fd | simnalamburt/snucse.pl | pp.ml | (*
* SNU 4190.310 Programming Languages
*
* SM5
*)
open K
open K
module KParseTreePrinter : sig val print : program -> unit end =
struct
let q x = ["\"" ^ x ^ "\""]
let pfx = " "
let indent l = List.map (fun s -> pfx ^ s) l
let rec comma = function [] -> []
| [h] -> [h ^ ","]
| (h :: t... | null | https://raw.githubusercontent.com/simnalamburt/snucse.pl/a130f826c6f27224c88b0dd2e1588f35bccc9ebb/hw5/pp.ml | ocaml |
* SNU 4190.310 Programming Languages
*
* SM5
|
open K
open K
module KParseTreePrinter : sig val print : program -> unit end =
struct
let q x = ["\"" ^ x ^ "\""]
let pfx = " "
let indent l = List.map (fun s -> pfx ^ s) l
let rec comma = function [] -> []
| [h] -> [h ^ ","]
| (h :: t) -> h :: (comma t)
let ps s l =
match l with
... |
0fd6a0e279d3db87708bb1004e716154692e59bce3bd0da8e417bd283807a31c | rlepigre/pml | ahash.mli | (** Modified version of the [Hashbtl] library, to work with types containing
functions. Physical equality is used when [Pervasives.compare] raises an
exception. Note that this is only used when the hash function leads to a
collision (and thus quite rarely). *)
(** The type of hash tables from type ['a] to ... | null | https://raw.githubusercontent.com/rlepigre/pml/cdfdea0eecc6767b16edc6a7bef917bc9dd746ed/src/util/ahash.mli | ocaml | * Modified version of the [Hashbtl] library, to work with types containing
functions. Physical equality is used when [Pervasives.compare] raises an
exception. Note that this is only used when the hash function leads to a
collision (and thus quite rarely).
* The type of hash tables from type ['a] to type ['... |
type ('a, 'b) t
val create : int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val reset : ('a, 'b) t -> unit
val copy : ('a, 'b) t -> ('a, 'b) t
* [ Hashtbl.add tbl key v ] adds a binding of [ key ] to [ v ] in table [ tbl ] . A
previous bindings for [ x ] is not removed , but simply hidden . If any , the
... |
e39bc5f4bd446459df9e3e2e0d7e1343105b99b120a3f75aa698944ba1069c39 | avsm/mirage-duniverse | stdio.ml | open! Base
open! Import
module In_channel = In_channel
module Out_channel = Out_channel
let stdin = In_channel.stdin
let stdout = Out_channel.stdout
let stderr = Out_channel.stderr
let eprintf = Out_channel.eprintf
let printf = Out_channel.printf
let print_endline = Out_channel.print_endline
let prerr... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/stdio/src/stdio.ml | ocaml | open! Base
open! Import
module In_channel = In_channel
module Out_channel = Out_channel
let stdin = In_channel.stdin
let stdout = Out_channel.stdout
let stderr = Out_channel.stderr
let eprintf = Out_channel.eprintf
let printf = Out_channel.printf
let print_endline = Out_channel.print_endline
let prerr... | |
484312c638bfc4878cdfe83bd9794d3068df15fc1bd6fb1ea520e1e20fda7402 | hswick/jutsu.ai | project.clj | (defproject hswick/jutsu.ai "0.1.5"
:description "Clojure wrapper for deeplearning4j intended to make machine learning on the JVM simpler"
:url ""
:dependencies [[org.clojure/clojure "1.8.0"]
[org.nd4j/nd4j-native-platform "1.0.0-beta" :scope "provided"]
[org.deeplearning4j/deepl... | null | https://raw.githubusercontent.com/hswick/jutsu.ai/5f9a20b0ef0360b74b67137853344e084347b48c/project.clj | clojure | (defproject hswick/jutsu.ai "0.1.5"
:description "Clojure wrapper for deeplearning4j intended to make machine learning on the JVM simpler"
:url ""
:dependencies [[org.clojure/clojure "1.8.0"]
[org.nd4j/nd4j-native-platform "1.0.0-beta" :scope "provided"]
[org.deeplearning4j/deepl... | |
5446525ffcbfb6c5db7bce5e93cabd65b9859402e08b2db19e95cba07f52456e | quchen/generative-art | Truchet.hs | module Main (main) where
import Control.Monad.Primitive
import Control.Monad.Reader.Class
import Control.Monad.ST
import Data.List (partition)
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Data.Traversable
import qualified Data.Vector as V... | null | https://raw.githubusercontent.com/quchen/generative-art/6372c7e36a4bcd09e2b22d3e395b6b6217f8601f/penplotting/Truchet/Truchet.hs | haskell | Already taken care of in 'strands'
gold pen requires veeeery low feedrate
Already taken care of in 'strands'
gold pen requires veeeery low feedrate | module Main (main) where
import Control.Monad.Primitive
import Control.Monad.Reader.Class
import Control.Monad.ST
import Data.List (partition)
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Data.Traversable
import qualified Data.Vector as V... |
0da617c258fc90645edf9b944b67fdeac430e6888823e3696195e00cd2a480cf | expipiplus1/vulkan | Camera.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
{-# OPTIONS_GHC -fplugin=Foreign.Storable.Generic.Plugin #-}
# OPTIONS_GHC -fplugin - opt = Foreign . Storable . Generic . Plugin:-v0 #
module Camera where
import Control.Lens
import Foreign.Storable.Generic
import GHC.Generics ... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/examples/lib/Camera.hs | haskell | # LANGUAGE DeriveAnyClass #
# OPTIONS_GHC -fplugin=Foreign.Storable.Generic.Plugin #
>>> projectionMatrix initialCamera
>>> tan (1.5 / 2)
>>> projectRay initialCamera (V2 0 0)
>>> projectRay initialCamera (V2 0 1)
>>> projectRay initialCamera (V2 1 0)
^ Origin, Direction
>>> projectToScreen initialCamera (V3 ... | # LANGUAGE DeriveGeneric #
# OPTIONS_GHC -fplugin - opt = Foreign . Storable . Generic . Plugin:-v0 #
module Camera where
import Control.Lens
import Foreign.Storable.Generic
import GHC.Generics ( Generic )
import Linear
data Camera = Camera
{ camPosition ... |
dadc885a9b5c07236467b2ceda3497bc6dd4d6116635e52c9f33993b2bbd6a5a | AnOctopus/haskell-minithesis | Examples.hs | module Examples where
import Relude
import TestCase
import Gen
example :: Property [Int]
example = do
l <- listRange 0 2000 int
r <- list int
l === r
example2 :: Property [Int]
example2 = do
l <- list int
l /== []
example3 :: Property Bool
example3 = do
i <- intRange 0 100
lst <- listRa... | null | https://raw.githubusercontent.com/AnOctopus/haskell-minithesis/933c9ab762468d7eaca716e4d609a0b1b850a322/src/Examples.hs | haskell | module Examples where
import Relude
import TestCase
import Gen
example :: Property [Int]
example = do
l <- listRange 0 2000 int
r <- list int
l === r
example2 :: Property [Int]
example2 = do
l <- list int
l /== []
example3 :: Property Bool
example3 = do
i <- intRange 0 100
lst <- listRa... | |
98926899c6a3160fd3722a3ff5ba304bdeb25e80040a3e4e81b716391d96f3e4 | hasktorch/hasktorch | Native6.hs |
-- generated by using spec/Declarations.yaml
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
module Torch.Internal.Unmanaged.Native.Native6 where
import Foreign.C.String
import Foreign.C.Types
im... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/6233c173e1dd9fd7218fd13b104da15fc457f67e/libtorch-ffi/src/Torch/Internal/Unmanaged/Native/Native6.hs | haskell | generated by using spec/Declarations.yaml
# LANGUAGE OverloadedStrings # |
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
module Torch.Internal.Unmanaged.Native.Native6 where
import Foreign.C.String
import Foreign.C.Types
import Foreign
import Torch.Internal.Type
import qualified Language.C.Inline.Cpp ... |
3a51334d9b9b9192d1acd18ea28f8df05a990751559a2fb9a0b39965e289013e | Shimuuar/histogram-fill | Read.hs | -- | Helper function for defining Read instances for bin data types.
module Data.Histogram.Bin.Read
( ws
, eol
, value
, maybeValue
, keyword
) where
import Text.Read
import Text.ParserCombinators.ReadP (ReadP, many, satisfy, char, string)
-- | Whitespaces
ws :: ReadP String
ws = many $ satisfy (`elem... | null | https://raw.githubusercontent.com/Shimuuar/histogram-fill/3dff15027390cf64e7fc3fbaac34c28ffcdacbd6/histogram-fill/Data/Histogram/Bin/Read.hs | haskell | | Helper function for defining Read instances for bin data types.
| Whitespaces
| End of line
| Equal sign
| Key value pair
| Return optional value
| Keyword | module Data.Histogram.Bin.Read
( ws
, eol
, value
, maybeValue
, keyword
) where
import Text.Read
import Text.ParserCombinators.ReadP (ReadP, many, satisfy, char, string)
ws :: ReadP String
ws = many $ satisfy (`elem` " \t")
eol :: ReadP Char
eol = char '\n'
eq :: ReadP ()
eq = ws >> char '=' >> ret... |
9f4c7ffd36169a5eaedfc17214062e8e7ae1c0904331cf9fec09a36c5cc9a856 | dmitryvk/sbcl-win32-threads | dlisp3.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
This software is derived from software originally released by Xerox
;;;; Corporation. Copyright and release statements follow. Later modifications
;;;; to the software are in the public domain and are provided with
;;;; absol... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/pcl/dlisp3.lisp | lisp | more information.
Corporation. Copyright and release statements follow. Later modifications
to the software are in the public domain and are provided with
absolutely no warranty. See the COPYING and CREDITS files for more
information.
All rights reserved.
Use and copying of this software and preparation of der... | This software is part of the SBCL system . See the README file for
This software is derived from software originally released by Xerox
copyright information from original PCL sources :
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation .
derivative works must comply with all applicabl... |
755707905d51a5bd07fe4bf1d865346d501698ec07ca95db3f7efb23e3707d09 | f-f/dhall-clj | import_test.clj | (ns dhall-clj.import-test
(:require [clojure.test :refer :all]
[medley.core :refer [map-vals]]
[dhall-clj.ast :refer :all]
[dhall-clj.core :as core]
[dhall-clj.parse :refer [parse expr]]
[dhall-clj.import :refer [resolve-imports get-cached-file]]
... | null | https://raw.githubusercontent.com/f-f/dhall-clj/05d25d2464972bbeae46d828b478b4cfd59836dc/test/dhall_clj/import_test.clj | clojure | Waiting for proper cycle detection
This last alpha-normalize is necessary so that cache works | (ns dhall-clj.import-test
(:require [clojure.test :refer :all]
[medley.core :refer [map-vals]]
[dhall-clj.ast :refer :all]
[dhall-clj.core :as core]
[dhall-clj.parse :refer [parse expr]]
[dhall-clj.import :refer [resolve-imports get-cached-file]]
... |
1623ac4cf0c4e064f837780d3c55a91047286e1e3a5146006e0eb7c44b8ecdaf | tfausak/strive | Comments.hs | -- | 'Strive.Actions.Comments'
module Strive.Options.Comments
( GetActivityCommentsOptions (..),
)
where
import Data.Aeson (encode)
import Data.ByteString.Char8 (unpack)
import Data.ByteString.Lazy (toStrict)
import Data.Default (Default, def)
import Network.HTTP.Types (QueryLike, toQuery)
-- | 'Strive.Actions.ge... | null | https://raw.githubusercontent.com/tfausak/strive/8bd61df4b2723301273b11589c5f237b42e934dc/source/library/Strive/Options/Comments.hs | haskell | | 'Strive.Actions.Comments'
| 'Strive.Actions.getActivityComments' | module Strive.Options.Comments
( GetActivityCommentsOptions (..),
)
where
import Data.Aeson (encode)
import Data.ByteString.Char8 (unpack)
import Data.ByteString.Lazy (toStrict)
import Data.Default (Default, def)
import Network.HTTP.Types (QueryLike, toQuery)
data GetActivityCommentsOptions = GetActivityCommentsO... |
3ba3acae3e1a9247401fd05cb6da44e1b3c241f9125eafdf21ce028dd2606f6c | jaredly/reason-language-server | translcore.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/406/translcore.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Asttypes
open Typedtree
open Lambda
val transl_exp: expression -> lambda
val transl_apply: ?should... |
b8af4f1fa5d46ed9647a92e240bd7888aa862d214d60665ead8ac1163c6120da | babashka/babashka | sigint_handler.clj | (ns babashka.impl.sigint-handler
{:no-doc true}
(:import [sun.misc Signal]
[sun.misc SignalHandler]))
(set! *warn-on-reflection* true)
(defn handle-sigint! []
(when-not (= "true" (System/getenv "BABASHKA_DISABLE_SIGNAL_HANDLERS"))
(Signal/handle
(Signal. "INT")
(reify SignalHandler
... | null | https://raw.githubusercontent.com/babashka/babashka/10638685549205926489ac325721261c301819d4/src/babashka/impl/sigint_handler.clj | clojure | This is needed to run shutdown hooks on interrupt, System/exit triggers those | (ns babashka.impl.sigint-handler
{:no-doc true}
(:import [sun.misc Signal]
[sun.misc SignalHandler]))
(set! *warn-on-reflection* true)
(defn handle-sigint! []
(when-not (= "true" (System/getenv "BABASHKA_DISABLE_SIGNAL_HANDLERS"))
(Signal/handle
(Signal. "INT")
(reify SignalHandler
... |
15831c65695f41cacfa69290cc2f7a19e0a7a558a57f2ee0543136472e9b8d35 | chaoxu/fancy-walks | B.hs | {-# OPTIONS_GHC -O2 #-}
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control.Monad.State
import Control.Monad
import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified Dat... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/code.google.com/codejam/Google%20Code%20Jam%202009/Qualification%20Round/B.hs | haskell | # OPTIONS_GHC -O2 # |
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control.Monad.State
import Control.Monad
import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as BS... |
06c81768ebb3eae52ebefc99acd0c528dd7e120aaf92fc5fed93bc202ac04555 | msantos/pkt | pkt_sctp.erl | Copyright ( c ) 2009 - 2022 , < >
%% 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
%% notice, this list of condition... | null | https://raw.githubusercontent.com/msantos/pkt/92fa4ec6903c1c0a7c564e7cd1c468a92e3e3f3b/src/pkt_sctp.erl | erlang | 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
notice, this list of conditions and the following disclaimer.
Redistributions in bi... | Copyright ( c ) 2009 - 2022 , < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
COPYRIGHT HOLDER OR FOR ANY DIRECT , INDIRECT ,
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,
BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
LOSS OF U... |
bb4c40144e41f5ef898b010fe9dbf10c19f03163380deb245684eb12c5455741 | felipecsl/show-do-milhao | Utils.hs | module Utils where
import Data.ByteString (ByteString (..))
import Data.ByteString.Char8 (unpack)
import Data.List.Split (keepDelimsL, split, whenElt)
import qualified Data.Text as T
import Data.Text.ICU.Convert (open, toUnicode)
import qualified Data.Tex... | null | https://raw.githubusercontent.com/felipecsl/show-do-milhao/cc1c7d48a72d68c38cad760654c3f2e50a3af03a/src/Utils.hs | haskell | Split an array using the function for selecting the delimiter. The resulting array includes | module Utils where
import Data.ByteString (ByteString (..))
import Data.ByteString.Char8 (unpack)
import Data.List.Split (keepDelimsL, split, whenElt)
import qualified Data.Text as T
import Data.Text.ICU.Convert (open, toUnicode)
import qualified Data.Tex... |
88c10310c3b7be79d46359c72ec6cae98bc5c5e5dd7af6512a4c39833e185be6 | processone/ejabberd | mod_mam_mnesia.erl | %%%-------------------------------------------------------------------
%%% File : mod_mam_mnesia.erl
Author : < >
Created : 15 Apr 2016 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
modify it under the terms o... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/mod_mam_mnesia.erl | erlang | -------------------------------------------------------------------
File : mod_mam_mnesia.erl
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even t... | Author : < >
Created : 15 Apr 2016 by < >
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
74837f8d4ec9099599fd863de51a6d83b7e761c28aa99b885b18687b92d5117a | input-output-hk/ouroboros-network | Utils.hs | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
module TestLib.Utils where
import Control.Monad.Class.MonadTime (DiffTime, Time, diffTime)
import Control.Monad.IOSim
import Data.Bifoldable (bifoldMap)
import Data.Bitraversable (bimapAccumL)
import Data.List ... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/163408cb58e13ac1ad63b8c947a71c491d00c4f8/ouroboros-network-framework/testlib/TestLib/Utils.hs | haskell | verifyTimeouts checks that in all \tau transition states the timeout is
respected. It does so by checking the stream of abstract transitions
paired with the time they happened, for a given connection; and checking
that transitions from \tau states to any other happens within the correct
^ If runnning in Diffusion... | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
module TestLib.Utils where
import Control.Monad.Class.MonadTime (DiffTime, Time, diffTime)
import Control.Monad.IOSim
import Data.Bifoldable (bifoldMap)
import Data.Bitraversable (bimapAccumL)
import Data.List ... |
7732cedb70fc3d5d9d1e95942ddb41f52bbcc2cfbb03cbf1500fa2ac149752b0 | penpot/penpot | websocket.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.websocket
(:require
[app.common.data.macros :as dm]
[app.common.logging :as l]
[a... | null | https://raw.githubusercontent.com/penpot/penpot/cc18f84d620e37d8efafc5bed1bcdbe70ec23c1e/frontend/src/app/main/data/websocket.cljs | clojure |
Copyright (c) KALEIDOS INC
--- Finalize Websocket | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.main.data.websocket
(:require
[app.common.data.macros :as dm]
[app.common.logging :as l]
[app.common.uri :as u]
[app.conf... |
e006a577a79cabcf5e1035c71eebc29bbf9c4bbee037ecf5847d96274acb9c3b | DeathKing/Hit-DataStructure-On-Scheme | ex1-3.scm | ;;; Find k in a vector
;;;
Written : >
;;; Find k in a vector
(define (vector-find-k v k)
(let ((l (vector-length v))
(i 0))
(if (= l 0)
#f
(let loop ((e (vector-ref v i))
(i 0))
(cond
((= e k) #t)
((= l (+ i 1)) #f)
(else
... | null | https://raw.githubusercontent.com/DeathKing/Hit-DataStructure-On-Scheme/11677e3c6053d6c5b37cf0509885f74ab5c2bab9/exercise1/ex1-3.scm | scheme | Find k in a vector
Find k in a vector
Find k in a list | Written : >
(define (vector-find-k v k)
(let ((l (vector-length v))
(i 0))
(if (= l 0)
#f
(let loop ((e (vector-ref v i))
(i 0))
(cond
((= e k) #t)
((= l (+ i 1)) #f)
(else
(loop (vector-ref v (+ i 1)) (+ i 1))))))))
(defi... |
8fca63570da9ede147235de67b8f32bc344529d3ab650450b59ffc1d8c6050ea | expipiplus1/vulkan | QueryResultFlagBits.hs | {-# language CPP #-}
-- No documentation found for Chapter "QueryResultFlagBits"
module Vulkan.Core10.Enums.QueryResultFlagBits ( QueryResultFlags
, QueryResultFlagBits( QUERY_RESULT_64_BIT
, QUERY_RESU... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/70d8cca16893f8de76c0eb89e79e73f5a455db76/src/Vulkan/Core10/Enums/QueryResultFlagBits.hs | haskell | # language CPP #
No documentation found for Chapter "QueryResultFlagBits"
| VkQueryResultFlagBits - Bitmask specifying how and when query results
are returned
= See Also
<-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
'QueryResultFlags'
| 'QUERY_RESULT_64_BIT' specifies the results will be writte... | module Vulkan.Core10.Enums.QueryResultFlagBits ( QueryResultFlags
, QueryResultFlagBits( QUERY_RESULT_64_BIT
, QUERY_RESULT_WAIT_BIT
... |
78c527e90d05a0f08d952612675cd7839ada2e37616ef5e2f1080b38ca69c0c1 | ghc/nofib | Degrees.hs | Glasow Haskell 0.403 : FINITE ELEMENT PROGRAM V2
-- **********************************************************************
-- * *
* FILE NAME : degrees.hs DATE : 13 - 3 - 1991 *
-- * *
-- * CONTENTS : Computes the degree numbers of ea... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/real/fem/Degrees.hs | haskell | **********************************************************************
* *
* *
* CONTENTS : Computes the degree numbers of each node. *
* *
* CHANGES : *
* Add new function degreesrlt for debug use. *
*************... | Glasow Haskell 0.403 : FINITE ELEMENT PROGRAM V2
* FILE NAME : degrees.hs DATE : 13 - 3 - 1991 *
* 1 . Mon Mar 11 10:28:10 GMT 1991 *
module Degrees( ndgrs, getndgr, degreesrlt ) where
import Data.Array
import Basics
import Vector
import DB_interface
ndgrs :: (Array Int Int, Array Int Float) -> I... |
51cdccfa49cb4f571a7b0f722ab1c1fb2cc1849f1fe6a13a48f6ed7abbbb7c8f | SleepyBag/leetcode-racket | 451.rkt | (define/contract (frequency-sort s)
(-> string? string?)
(list->string
(let ([cnt
(let count ([s (string->list s)])
(if (null? s)
(hash)
(hash-update (count (cdr s)) (car s) add1 1)
)
) ])
(sort (st... | null | https://raw.githubusercontent.com/SleepyBag/leetcode-racket/470a42a186a00228bcac3c3c40af5785fa761186/451.rkt | racket | (define/contract (frequency-sort s)
(-> string? string?)
(list->string
(let ([cnt
(let count ([s (string->list s)])
(if (null? s)
(hash)
(hash-update (count (cdr s)) (car s) add1 1)
)
) ])
(sort (st... | |
1e5ac4bdfcf5563f5e2ab1d379669c878ad98633b7c7dbeeb4edd4a9b75f6820 | haskell/vector | drop.hs | import qualified Data.Vector as U
import Data.Bits
main = print . U.length . U.drop 100000 . U.replicate 1000000 $ (7 :: Int)
| null | https://raw.githubusercontent.com/haskell/vector/4c87e88f07aad166c6ae2ccb94fa539fbdd99a91/old-testsuite/microsuite/drop.hs | haskell | import qualified Data.Vector as U
import Data.Bits
main = print . U.length . U.drop 100000 . U.replicate 1000000 $ (7 :: Int)
| |
ef8c871ec70948ed1673937b364f088762c8e3bae960ee6b337ac7fc949f7d04 | incoherentsoftware/defect-process | Sprites.hs | module Enemy.All.Boss.Sprites
( EnemySprites(..)
, mkEnemySprites
) where
import Control.Monad.IO.Class (MonadIO)
import FileCache
import Window.Graphics
data EnemySprites = EnemySprites
{ _spawn :: Sprite
, _death :: Sprite
, _airDeath :: Sprite
, _airDeathLand ... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/8797aad1d93bff5aadd7226c39a48f45cf76746e/src/Enemy/All/Boss/Sprites.hs | haskell | module Enemy.All.Boss.Sprites
( EnemySprites(..)
, mkEnemySprites
) where
import Control.Monad.IO.Class (MonadIO)
import FileCache
import Window.Graphics
data EnemySprites = EnemySprites
{ _spawn :: Sprite
, _death :: Sprite
, _airDeath :: Sprite
, _airDeathLand ... | |
b742c1ed759b569fa5c08f8aeb3b58591e0ba6ca4201f3d1f08c7c464efdac11 | holdybot/holdybot | config.clj | (ns parky.config
(:require [cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate]]))
(defstate env
:start
(load-config
:merge
[(args)
(source/from-system-props)
(source/from-env)]))
| null | https://raw.githubusercontent.com/holdybot/holdybot/e65007a3113c89b3f457b9d966d6bf305983c975/src/clj/parky/config.clj | clojure | (ns parky.config
(:require [cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate]]))
(defstate env
:start
(load-config
:merge
[(args)
(source/from-system-props)
(source/from-env)]))
| |
2c98e47714c0578348dc6bfe4daf6c00df1e07fd3807be512addf036c874562a | MyPost/cassius | project.clj | (defproject au.com.auspost/cassius "0.1.15-SNAPSHOT"
:description "Cassandra as a Big Nested Map"
:url "-tools/cassius"
:license {:name "Apache License - v2.0"
:url "-2.0.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[im.chit/ribol "0.4.0"]
[im.chit/hara.nam... | null | https://raw.githubusercontent.com/MyPost/cassius/7b5f550fa8e8f825d4ecd7ba6a0d34c5ff606a7c/project.clj | clojure | (defproject au.com.auspost/cassius "0.1.15-SNAPSHOT"
:description "Cassandra as a Big Nested Map"
:url "-tools/cassius"
:license {:name "Apache License - v2.0"
:url "-2.0.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[im.chit/ribol "0.4.0"]
[im.chit/hara.nam... | |
974f40ef30a5bc5b39e6c54d3e36ebc3f6d095911af983e21cec9686c8633135 | kmi/ocml | operator.lisp | -*- Mode : LISP ; Syntax : Common - lisp ; Base : 10 ; Package : ; -*-
(in-package ocml)
Operators can be used in the LHS of backward rules and in the RHS of forward rules to
;;;carry out operations such as adding new facts, printing, etc..
;;;In this file we define the machinery supporting the definition of op... | null | https://raw.githubusercontent.com/kmi/ocml/90b0b173f588c580c26393c94f9970282c640f4d/src/operator.lisp | lisp | Syntax : Common - lisp ; Base : 10 ; Package : ; -*-
carry out operations such as adding new facts, printing, etc..
In this file we define the machinery supporting the definition of operators |
(in-package ocml)
Operators can be used in the LHS of backward rules and in the RHS of forward rules to
(defvar *operators* (make-hash-table))
(defun add-operator (name structure)
(setf (gethash name *operators*)structure))
(defun get-operator (name)
(gethash name *operators*))
(defun remove-operator (name)... |
4340d392288aa2e1b1a31046bb36d6ae84e142c4903019d101a89666b2f34ed0 | singleheart/programming-in-haskell | ex4.hs | newtype ZipList a =
Z [a]
deriving (Show)
instance Functor ZipList
-- fmap :: (a -> b) -> ZipList a -> ZipList b
where
fmap g (Z xs) = Z (fmap g xs)
instance Applicative ZipList
-- pure :: a -> ZipList a
where
pure x = Z (... | null | https://raw.githubusercontent.com/singleheart/programming-in-haskell/80c7efc0425babea3cd982e47e121f19bec0aba9/ch12/ex4.hs | haskell | fmap :: (a -> b) -> ZipList a -> ZipList b
pure :: a -> ZipList a
(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b | newtype ZipList a =
Z [a]
deriving (Show)
instance Functor ZipList
where
fmap g (Z xs) = Z (fmap g xs)
instance Applicative ZipList
where
pure x = Z (repeat x)
(Z gs) <*> (Z xs) = Z [g x | (g, x) <- zip gs xs]
|
e4bba0c1225923aa573593403a568b88ced3fdc5ef1b1ec0db95da0273d7dff0 | mediquest-nl/logback-masking-pattern-layouts | util.clj | (ns nl.mediquest.logback.util
(:require
[clojure.string :as string]))
;; Regexes used with string/replace, applied from top to bottom
(def default-re->replacement
(array-map
;; Common patterns
#"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5... | null | https://raw.githubusercontent.com/mediquest-nl/logback-masking-pattern-layouts/585fed98c15d15ca22d9b48bb97c037aa0068649/src/nl/mediquest/logback/util.clj | clojure | Regexes used with string/replace, applied from top to bottom
Common patterns
Found in code | (ns nl.mediquest.logback.util
(:require
[clojure.string :as string]))
(def default-re->replacement
(array-map
#"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\... |
446b5fc37a1e3f9cbe2288cca14862d7e904d5fb619fffdf89f2de751194fc2e | jixiuf/helloerlang | mochiweb_test_web.erl | @author Mochi Media < >
@copyright 2010 Mochi Media < >
%% @doc Web server for mochiweb_test.
-module(mochiweb_test_web).
-author("Mochi Media <>").
-export([start/1, stop/0, loop/2]).
%% External API
start(Options) ->
{DocRoot, Options1} = get_option(docroot, Options),
Loop = fun (Req) ->
... | null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/mochiweb_test/src/mochiweb_test_web.erl | erlang | @doc Web server for mochiweb_test.
External API
get query string
NOTE: mustache templates need \ because they are not awesome.
Internal API
Tests
| @author Mochi Media < >
@copyright 2010 Mochi Media < >
-module(mochiweb_test_web).
-author("Mochi Media <>").
-export([start/1, stop/0, loop/2]).
start(Options) ->
{DocRoot, Options1} = get_option(docroot, Options),
Loop = fun (Req) ->
?MODULE:loop(Req, DocRoot)
end,
... |
c721a5f38cd39bcd9805836d38bc1e69c846718ddaa052c234b03b6c7110dad7 | kudelskisecurity/scannerl | fp_mqtts.erl | %%% MQTT over SSL fingerprinting module
%%%
%%% Output:
%%% mqtt or not_mqtt atoms
%%%
-module(fp_mqtts).
-author("Adrien Giner - ").
-behavior(fp_module).
-include("../includes/args.hrl").
-export([callback_next_step/1]).
-export([get_default_args/0]).
-export([get_description/0]).
-export([get_arguments/0]).
%... | null | https://raw.githubusercontent.com/kudelskisecurity/scannerl/8133065030d014401c47b2470e67a36e9df81b1e/src/fpmodules/fp_mqtts.erl | erlang | MQTT over SSL fingerprinting module
Output:
mqtt or not_mqtt atoms
our record for this fingerprint
milli-seconds
HTTP port
transport type
max packet expected
API
public API to get {port, timeout}
callback
no packet received
debug
send debug
utils
|
-module(fp_mqtts).
-author("Adrien Giner - ").
-behavior(fp_module).
-include("../includes/args.hrl").
-export([callback_next_step/1]).
-export([get_default_args/0]).
-export([get_description/0]).
-export([get_arguments/0]).
-define(DESCRIPTION, "TCP/8883: MQTT over SSL identification").
-define(ARGUMENTS, []).
g... |
e4b0c532ba9ace79a6cc94a2d2dae3e535f23628f07cabd1dbaf2120fb9b25bb | resistor/hzertz | Main.hs | module Main where
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
import qualified Callbacks as Callbacks
-- NEW MAIN
initDisplay :: IO ()
initDisplay = do
initialDisplayMode $= [DoubleBuffered]
initialWindowSize $= Size 800 600
createWindow "Zertz"
Callbacks.registerCallbacks
lineSmooth $=... | null | https://raw.githubusercontent.com/resistor/hzertz/d1910ff8ae530bdc98f21d766a6372c4e5a0974b/Main.hs | haskell | NEW MAIN
OLD MAIN
run_minimax str_state =
state = read str_state in
prompt = do
putStr "Move? "
IO.hFlush IO.stdout
state <- getLine
putStrLn $ "\nState: " ++ (run_minimax state) ++ "\n"
prompt
oldmain = do
prompt | module Main where
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
import qualified Callbacks as Callbacks
initDisplay :: IO ()
initDisplay = do
initialDisplayMode $= [DoubleBuffered]
initialWindowSize $= Size 800 600
createWindow "Zertz"
Callbacks.registerCallbacks
lineSmooth $= Enabled
p... |
8b619f8b6e6748a35779557c6c286050a851f51153dbc01e734f6ec97f2d4289 | dhleong/wish | generic_info.cljs | (ns wish.sheets.dnd5e.overlays.generic-info
(:require [clojure.string :as str]
[spade.core :refer [defattrs]]
[wish.sheets.dnd5e.subs.proficiency :as proficiency]
[wish.sheets.dnd5e.util :refer [ability->mod
mod->str]]
[wish.s... | null | https://raw.githubusercontent.com/dhleong/wish/db5d22763d9bce17dd5af22754de47c6dcacc68e/src/cljs/wish/sheets/dnd5e/overlays/generic_info.cljs | clojure | ======= Item/Spell generic info =========================
======= Ally info =======================================
We might consider extra details on attacks, but the feature listing
is probably sufficient for now | (ns wish.sheets.dnd5e.overlays.generic-info
(:require [clojure.string :as str]
[spade.core :refer [defattrs]]
[wish.sheets.dnd5e.subs.proficiency :as proficiency]
[wish.sheets.dnd5e.util :refer [ability->mod
mod->str]]
[wish.s... |
c4188493239110be05027ef8f8761f1f6bf10a0d7eb12e56fef1c120b27e8376 | xmonad/xmonad-contrib | SwapPromote.hs | -----------------------------------------------------------------------------
-- |
Module : XMonad . Actions . SwapPromote
-- Description : Track the master window history per workspace.
Copyright : ( c ) 2018
-- License : BSD-style (see LICENSE)
--
-- Maintainer :
-- Stability : unstable
-... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/e0d1f177ea6c620b7612e431ff01b3ca1a62c829/XMonad/Actions/SwapPromote.hs | haskell | ---------------------------------------------------------------------------
|
Description : Track the master window history per workspace.
License : BSD-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : unportable
Module for tracking master window history per workspace, and associa... | Module : XMonad . Actions . SwapPromote
Copyright : ( c ) 2018
module XMonad.Actions.SwapPromote
MasterHistory (..)
, getMasterHistoryMap
, getMasterHistoryFromTag
, getMasterHistoryCurrent
, getMasterHistoryFromWindow
, modifyMasterHistoryFromTag
, modifyMasterHistory... |
f95f5ab65d7c9b84bf6850c366810faf4ff231ccd466bc5f6cf3d74d6b8ea6b6 | ChrisPenner/comonads-by-example | FileTree.hs | # LANGUAGE TypeOperators #
module Comonads.Cofree.FileTree where
import Control.Comonad
import Control.Comonad.Env
import Control.Comonad.Cofree
import Control.Monad.Free
import qualified Control.Monad.Trans.Free as FF
import Control.Arrow
import Data.Traversable
import Data.Functor.Compose
import Data.Functor.Foldabl... | null | https://raw.githubusercontent.com/ChrisPenner/comonads-by-example/1d7626f759e59ac8019322612ed6d7ff00da75c9/drafts/FileTree.hs | haskell | deeper :: FileTreeC -> IO FileTreeC
deeper = sequenceA . (>>= go)
where
go :: FileTreeIO -> Free (Env [FilePath] `Compose` (M.Map FilePath))
go (_ :< Compose ioNext) =
go
:: FF.FreeF
(Compose (Env [FilePath]) (M.Map FilePath))
(Cofree (Compose IO (M.Map FilePath)) [FilePat... | # LANGUAGE TypeOperators #
module Comonads.Cofree.FileTree where
import Control.Comonad
import Control.Comonad.Env
import Control.Comonad.Cofree
import Control.Monad.Free
import qualified Control.Monad.Trans.Free as FF
import Control.Arrow
import Data.Traversable
import Data.Functor.Compose
import Data.Functor.Foldabl... |
325988647232aad7c5ca2698b7111af450ed83896b063fe228941a346310a4d5 | jeapostrophe/exp | test.rkt | #lang racket/base
(require "m.rkt")
(require "n.rkt")
| null | https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/nsmv/test.rkt | racket | #lang racket/base
(require "m.rkt")
(require "n.rkt")
| |
7b2f86cf0f4777235f6e17fc57b67353c09b9f626d34e3c2983399b027c967ec | scrintal/heroicons-reagent | eye_dropper.cljs | (ns com.scrintal.heroicons.outline.eye-dropper)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/outline/eye_dropper.cljs | clojure | (ns com.scrintal.heroicons.outline.eye-dropper)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | |
0f6d1660942d182b2f9c22adb76c7fdb11854dc46a921c44d0852ac9deb119c1 | timbod7/haskell-chart | example10.hs | import Graphics.Rendering.Chart
import Graphics.Rendering.Chart.Backend.Cairo
import Data.Default.Class
import Data.Colour
import Data.Colour.Names
import Control.Lens
import System.Environment(getArgs)
chart = toRenderable layout
where
vals :: [(Double,Double,Double,Double)]
vals = [ (x,sin (exp x),sin x/2,... | null | https://raw.githubusercontent.com/timbod7/haskell-chart/8c5a823652ea1b4ec2adbced4a92a8161065ead6/wiki-examples/example10.hs | haskell | import Graphics.Rendering.Chart
import Graphics.Rendering.Chart.Backend.Cairo
import Data.Default.Class
import Data.Colour
import Data.Colour.Names
import Control.Lens
import System.Environment(getArgs)
chart = toRenderable layout
where
vals :: [(Double,Double,Double,Double)]
vals = [ (x,sin (exp x),sin x/2,... | |
78ae7a92dcfb8d47dd07ee48a99de833fc12edef066c14aa496cec2f188164b5 | rpeszek/typed-encoding | Encoding.hs |
# LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
| Lazy version of " Data . . Conv . Text . Encoding "
-- @since 0.2.2.0
module Data.TypedEncoding.Conv.Text.Lazy.Encoding where
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text.La... | null | https://raw.githubusercontent.com/rpeszek/typed-encoding/441f9f3bbf849f485f82eae66402ee2fd7b47a34/src/Data/TypedEncoding/Conv/Text/Lazy/Encoding.hs | haskell | @since 0.2.2.0
| simplified version of @decodeUtf8@ that works on single /r-/ encodings
@since 0.5.2.0
| simplified version of @decodeUtf8@ that works on single /r-/ encodings
@since 0.5.2.0 |
# LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
| Lazy version of " Data . . Conv . Text . Encoding "
module Data.TypedEncoding.Conv.Text.Lazy.Encoding where
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text.Lazy as TL
import qu... |
e371f8754c12e7869dac420c47b54fabbfd2d0da2d489d67a862c7d67681346a | okuoku/nausicaa | test-sentinel.sps | ;;;
Part of : / Scheme
;;;Contents: tests for the sentinel library
Date : Tue Jul 7 , 2009
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2009 < >
;;;
;;;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 Fo... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/scheme/tests/test-sentinel.sps | scheme |
Contents: tests for the sentinel library
Abstract
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
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRAN... | Part of : / Scheme
Date : Tue Jul 7 , 2009
Copyright ( c ) 2009 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
#!r6rs
(import (nausicaa)
(nausicaa language sentine... |
d39d510bf5ea7aab53bfe3638f17b6c9aa6f0c1ae2226ecd196827697e8c4235 | Bannerets/camlproto | Crypto.ml | open! Base
open Js_of_ocaml
type sha1_t
class type js_sha1 = object
method init: unit -> sha1_t Js.meth
method feed : t - > Typed_array.arrayBuffer Js.t - > unit Js.meth
method feed: sha1_t -> Cstruct.buffer -> unit Js.meth
method get: sha1_t -> Typed_array.arrayBuffer Js.t Js.meth
end
let js_sha1: js_sha1 J... | null | https://raw.githubusercontent.com/Bannerets/camlproto/d7c023f573ce6a9e7801aaa0962946f2f8cdc675/src/platform/js/Crypto.ml | ocaml | open! Base
open Js_of_ocaml
type sha1_t
class type js_sha1 = object
method init: unit -> sha1_t Js.meth
method feed : t - > Typed_array.arrayBuffer Js.t - > unit Js.meth
method feed: sha1_t -> Cstruct.buffer -> unit Js.meth
method get: sha1_t -> Typed_array.arrayBuffer Js.t Js.meth
end
let js_sha1: js_sha1 J... | |
d87fe9d091000a8eb827ad2d8860769163f9a312da06233eaf1667a76dd20f03 | triffon/fp-2021-22 | code.rkt | #lang racket
(define-syntax-rule (my-delay x) (lambda () x))
(define (my-delay2 x) (lambda () x))
(define (my-force p) (p))
(define-syntax-rule (my-stream-cons x s)
(cons x (my-delay s)))
(define (my-stream-first s)
(car s))
(define (my-stream-rest s)
(my-force (cdr s)))
(define my-empty-stream 'empty-stream... | null | https://raw.githubusercontent.com/triffon/fp-2021-22/e8e71eb7f36b9e8f9ec59e336def384e063208a8/exercises/3/09-scheme-stream/code.rkt | racket | задачи
вариант с безкрайно сито на Ератостен | #lang racket
(define-syntax-rule (my-delay x) (lambda () x))
(define (my-delay2 x) (lambda () x))
(define (my-force p) (p))
(define-syntax-rule (my-stream-cons x s)
(cons x (my-delay s)))
(define (my-stream-first s)
(car s))
(define (my-stream-rest s)
(my-force (cdr s)))
(define my-empty-stream 'empty-stream... |
bef63ed280a6b5063c826d263f597f803e8e575eba44b7cf2e75c0f4b1e1145f | fragnix/fragnix | Data.IntMap.Lazy.hs | # LANGUAGE Haskell98 #
{-# LINE 1 "Data/IntMap/Lazy.hs" #-}
# LANGUAGE CPP #
{-# LANGUAGE Safe #-}
... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/Data.IntMap.Lazy.hs | haskell | # LINE 1 "Data/IntMap/Lazy.hs" #
# LANGUAGE Safe #
---------------------------------------------------------------------------
|
Module : Data.IntMap.Lazy
License : BSD-style
Maintainer :
Portability : portable
An efficient implementation of maps from integer keys to values
(dictionaries).
API ... | # LANGUAGE Haskell98 #
# LANGUAGE CPP #
... |
3029f0738044a693b1b0ae1ad5256f1ed8405d9368c5e29240254aec6a43b009 | justinethier/cyclone | simple.scm | ;; Experimenting with primitives and continuations.
;; There are several primitives that do not require conts. Can we
;; compile them in such as way that they are not wrapped in a cont?
;; idea is to reduce compiled code, and number of allocated closures.
(import
(scheme base)
(scheme write))
(define (test a b c)... | null | https://raw.githubusercontent.com/justinethier/cyclone/a1c2a8f282f37ce180a5921ae26a5deb04768269/tests/debug/compilation/simple.scm | scheme | Experimenting with primitives and continuations.
There are several primitives that do not require conts. Can we
compile them in such as way that they are not wrapped in a cont?
idea is to reduce compiled code, and number of allocated closures. | (import
(scheme base)
(scheme write))
(define (test a b c)
(write
(cons
(+ a b c)
(- a b c))))
(test 1 2 3)
|
9bb8d4760dc26c5476eb59a1b2cb721fc5ae3a9955ec92db62ac5163350c0818 | futurice/haskell-mega-repo | SubcontractorHoursNotifications.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Futurice.App.Reports.SubcontractorHoursNotifications where
import Data.Aeson (object, (.=))
import Data.Time.Calendar (addGregorianMonthsClip)
import Data.Time.Calendar.WeekDate (toWeekDate)
import Futurice.Integrations... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/reports-app/src/Futurice/App/Reports/SubcontractorHoursNotifications.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Futurice.App.Reports.SubcontractorHoursNotifications where
import Data.Aeson (object, (.=))
import Data.Time.Calendar (addGregorianMonthsClip)
import Data.Time.Calendar.WeekDate (toWeekDate)
import Futurice.Integrations (beginningOfCurrMonth)
impor... |
289eb787981b8cf0b99b0a428c1c0ea800a4a65b0dbdfe942ec938dd4c320baa | logicmoo/wam_common_lisp | util.lsp | (in-package #:compiler)
(defvar file-list
'( "defmacro.lsp" "evalmacros.lsp" "top.lsp"
"module.lsp" "predlib.lsp" "setf.lsp"
"arraylib.lsp" "assert.lsp" "defstruct.lsp"
"describe.lsp" "iolib.lsp" "listlib.lsp"
"mislib.lsp" "numlib.lsp" "packlib.lsp"
"seq.lsp" "seqlib.lsp" "trace.lsp"
"thread.lsp" "loop.lsp"))
... | null | https://raw.githubusercontent.com/logicmoo/wam_common_lisp/4396d9e26b050f68182d65c9a2d5a939557616dd/prolog/wam_cl/src/lsp/util.lsp | lisp | (in-package #:compiler)
(defvar file-list
'( "defmacro.lsp" "evalmacros.lsp" "top.lsp"
"module.lsp" "predlib.lsp" "setf.lsp"
"arraylib.lsp" "assert.lsp" "defstruct.lsp"
"describe.lsp" "iolib.lsp" "listlib.lsp"
"mislib.lsp" "numlib.lsp" "packlib.lsp"
"seq.lsp" "seqlib.lsp" "trace.lsp"
"thread.lsp" "loop.lsp"))
... | |
025f173099f31904982c7baa245f7b13e0baf28387395855d9231aad92a4d20a | ygmpkk/house | Container.hs | module Container where
import GadgetsPrelude
import Components
import Button
import Display
import Area(subtractArea)
import Useful(mapC)
import Layout
data WrapAttributes = WrapAttributes Int DrawFun
instance HasBorder WrapAttributes where
border b (WrapAttributes _ df) = (WrapAttributes b df)
instance HasPictur... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/kernel/Gadgets/lib/Container.hs | haskell | SLIDERS -- | module Container where
import GadgetsPrelude
import Components
import Button
import Display
import Area(subtractArea)
import Useful(mapC)
import Layout
data WrapAttributes = WrapAttributes Int DrawFun
instance HasBorder WrapAttributes where
border b (WrapAttributes _ df) = (WrapAttributes b df)
instance HasPictur... |
586043c5fc25bf438462ba0b6d3abda8a3b743ff3cc9fc3363a481388c5d6b6b | batterseapower/haskell-kata | StreamFusionReassoc.hs | # LANGUAGE ExistentialQuantification , BangPatterns , TypeOperators #
import Prelude hiding (enumFromTo, concatMap, replicate)
data Stream a = forall s. Stream !(s -> Step a s) -- a stepper function
!s -- an initial state
-- | A stream step.
--
-- A step either ends ... | null | https://raw.githubusercontent.com/batterseapower/haskell-kata/49c0c5cf48f8e5549131c78d026e4f2aa73d8a7a/StreamFusionReassoc.hs | haskell | a stepper function
an initial state
| A stream step.
A step either ends a stream, skips a value, or yields a value
| Construct an abstract stream from a list.
# INLINE [0] stream #
| Flatten a stream back into a list.
# INLINE [0] unstream #
/The/ stream fusion rule
# INLINE [0] replicateS #
# INLINE [0] e... | # LANGUAGE ExistentialQuantification , BangPatterns , TypeOperators #
import Prelude hiding (enumFromTo, concatMap, replicate)
data Step a s = Yield a !s
| Skip !s
| Done
stream :: [a] -> Stream a
stream xs0 = Stream next xs0
where
# INLINE next #
next [] = Done
next (x:... |
3e2fcb4b240b93d33693bfde82f6bd95d4bc21022dffc533344a24591873c9f4 | active-group/reacl-c | reacl_c.clj | (ns hooks.reacl-c
(:require [clj-kondo.hooks-api :as api]
[clojure.string :as str]))
(defn- rewrite-list [expr f]
;; rewrite children list of a list-node to a single new node.
(-> expr
(update :node
(fn [node]
(if (api/list-node? node)
(let [cs (:... | null | https://raw.githubusercontent.com/active-group/reacl-c/53fec3e78e61176a6c4a2376cf88c0e6c4e99e22/resources/clj-kondo.exports/de.active-group/reacl-c/hooks/reacl_c.clj | clojure | rewrite children list of a list-node to a single new node.
just keep? or an error?
TODO: proper error
How to f*ing reuse what there is already for schema.core???
multi arity
multiple nodes in a 'do'
TODO: maybe register a finding if x is some other keyword than :static or :-
TODO: add finding when no args?
(wi... | (ns hooks.reacl-c
(:require [clj-kondo.hooks-api :as api]
[clojure.string :as str]))
(defn- rewrite-list [expr f]
(-> expr
(update :node
(fn [node]
(if (api/list-node? node)
(let [cs (:children node)]
(let [res (f cs)]
... |
6afb7f641d36dda346d36f82408ac96e715d5633e86a366c7ce2e88bc8061be3 | untangled-web/untangled-ui | parser_spec.clj | (ns untangled.ui.server.image-library.parser-spec
(:require
[com.stuartsierra.component :as component]
[untangled-spec.core :refer [specification behavior component assertions]]
[untangled.ui.server.image-library.parser :as src]
[untangled.ui.server.image-library :as src.lib]
[untangled.ui.server.... | null | https://raw.githubusercontent.com/untangled-web/untangled-ui/ae101f90cd9b7bf5d0c80e9453595fdfe784923c/src/test/untangled/ui/server/image_library/parser_spec.clj | clojure | (ns untangled.ui.server.image-library.parser-spec
(:require
[com.stuartsierra.component :as component]
[untangled-spec.core :refer [specification behavior component assertions]]
[untangled.ui.server.image-library.parser :as src]
[untangled.ui.server.image-library :as src.lib]
[untangled.ui.server.... | |
ddbe847fea6c097ec396979bb2429734076231a96eb64d9fb3de89881f1962a0 | nasa/PRECiSA | MapRealPVSLangAST.hs | -- Notices:
--
Copyright 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration . All Rights Reserved .
-- Disclaimers
No Warranty : THE SUBJECT SOFTWARE IS PROVIDED " AS IS " WITHOUT ANY WARRANTY OF ANY KIND , EITHER EXPRESSED , IMPLIED , OR STATUTO... | null | https://raw.githubusercontent.com/nasa/PRECiSA/91e1e7543c5888ad5fb123d3462f71d085b99741/PRECiSA/src/MapRealPVSLangAST.hs | haskell | Notices:
Disclaimers | Copyright 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration . All Rights Reserved .
No Warranty : THE SUBJECT SOFTWARE IS PROVIDED " AS IS " WITHOUT ANY WARRANTY OF ANY KIND , EITHER EXPRESSED , IMPLIED , OR STATUTORY , INCLUDING , BUT NOT LIMIT... |
7f17158d4c2eb5a371684193efda075555c969b4f76b16f7adfb3eba6f3cf483 | niquola/reframe-template | core.cljs | (ns ui.core
(:require-macros [reagent.ratom :refer [reaction]])
(:require
[clojure.string :as str]
[cljsjs.react]
[reagent.core :as reagent]
[re-frame.core :as rf]
[frames.routing]
[frames.xhr]
[frames.debounce]
[frames.cookies :as cookies]
[frames.openid :as openid]
[frames.redirect :... | null | https://raw.githubusercontent.com/niquola/reframe-template/6482afabc1967d2b6cb39ddc3fc0158075535700/srcs/ui/core.cljs | clojure | [ui.pages.core :as pages]
(def base-url "")
(def open-id-keys
{:client-id "khI6JcdsQ3dgHMdWJnej0OZjr5DXGWRU"
:uri ""})
this is the root component wich switch pages
using current-route key from database
application
handler use coefects cookies & openid to check for
user in cookies or in location string (a... | (ns ui.core
(:require-macros [reagent.ratom :refer [reaction]])
(:require
[clojure.string :as str]
[cljsjs.react]
[reagent.core :as reagent]
[re-frame.core :as rf]
[frames.routing]
[frames.xhr]
[frames.debounce]
[frames.cookies :as cookies]
[frames.openid :as openid]
[frames.redirect :... |
7b82c920dbaf1af79705c9283e5491af86400681f015659ddbfd244417ca319a | madvas/catlantis | detail.cljs | (ns catlantis.ios.screens.detail
(:require [catlantis.shared.ui :as ui]
[re-frame.core :as rf]
[print.foo :as pf :include-macros true]
[reagent.core :as r]))
(declare styles)
(def close-icon (js/require "./images/close.png"))
(def star-icon (js/require "./images/star.png"))
(def ... | null | https://raw.githubusercontent.com/madvas/catlantis/b8880ec2cab27ecfcb3c0ab30e2bbc7767db0d1c/src/catlantis/ios/screens/detail.cljs | clojure | (ns catlantis.ios.screens.detail
(:require [catlantis.shared.ui :as ui]
[re-frame.core :as rf]
[print.foo :as pf :include-macros true]
[reagent.core :as r]))
(declare styles)
(def close-icon (js/require "./images/close.png"))
(def star-icon (js/require "./images/star.png"))
(def ... | |
5c00f66082ad6fd5a5e60f455c1d8406b3b23ff7fbdeb37d830ba8a9cdf2af21 | xsc/kithara | test.clj | (ns kithara.test
(:require [kithara.test
[fixtures :as fix]
[property :as property]
[stack :as stack]]
[potemkin :refer [import-vars]]))
(import-vars
[kithara.test.fixtures
connection-config
exchange-name
publish!
use-rabbitmq-fixtures]
[kithara.tes... | null | https://raw.githubusercontent.com/xsc/kithara/3394a9e9ef5e6e605637a74e070c7d24bfaf19cc/test/kithara/test.clj | clojure | (ns kithara.test
(:require [kithara.test
[fixtures :as fix]
[property :as property]
[stack :as stack]]
[potemkin :refer [import-vars]]))
(import-vars
[kithara.test.fixtures
connection-config
exchange-name
publish!
use-rabbitmq-fixtures]
[kithara.tes... | |
593d3df755632d1e706e256029eefebb3915f3f0d9de7bf553c48fab7fb09268 | tisnik/clojure-examples | core_test.clj | (ns ircbot2.core-test
(:require [clojure.test :refer :all]
[ircbot2.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/ircbot2/test/ircbot2/core_test.clj | clojure | (ns ircbot2.core-test
(:require [clojure.test :refer :all]
[ircbot2.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
4f28fc06f80cb3e9063c86d69d04db32fe97c6f001fb26e8eb5da5b90c9bfad8 | ravichugh/djs | test03.ml |
#use "tests/functional/arrays/__arrays.ml"
val tup4 :: {(and (v::Arr({(or (Int v) (Bool v) (Str v))}))
(packed v) (= (len v) 4)
(Int (sel v 0))
(Bool (sel v 1)))}
let _ :: Int =
([{(or (Int v) (Bool v) (Str v))}] geti) tup4 0 in
let _ :: Bool =
([{(or (Int v... | null | https://raw.githubusercontent.com/ravichugh/djs/c4a13e06adb3e0945f39966523a4d944448c1941/tests/functional/arrays/test03.ml | ocaml |
#use "tests/functional/arrays/__arrays.ml"
val tup4 :: {(and (v::Arr({(or (Int v) (Bool v) (Str v))}))
(packed v) (= (len v) 4)
(Int (sel v 0))
(Bool (sel v 1)))}
let _ :: Int =
([{(or (Int v) (Bool v) (Str v))}] geti) tup4 0 in
let _ :: Bool =
([{(or (Int v... | |
695f67ac8e8e877d8c21ca3217788ad142415fbe65595e5f95ed19a7eaebe41a | SKA-ScienceDataProcessor/RC | Types.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE TemplateHaskell #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable, DeriveTraversable #-}
# LANGUAGE DeriveGeneric #
module DNA.Types where
import Control... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS2/lib/DNA/Types.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE BangPatterns #
# LANGUAGE DeriveDataTypeable, DeriveFunctor #
# LANGUAGE DeriveFoldable, DeriveTraversable #
--------------------------------------------------------------
--------------------------------------------------------------
| Monad to which computations in the 'Process' could b... | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveGeneric #
module DNA.Types where
import Control.Applicative
import Control.Monad.IO.Class
import Control.Monad.State (StateT)
import Control.Monad.Except
import Control.Monad.Reader
import Control.Distr... |
b6bccfbbd7e1057a8c68c6c058c5b3c72d745bff8fa04406a9ff84cceca8e4e7 | jdormit/sicp-logic | core.clj | (ns sicp-logic.core
(:require [sicp-logic.binding :refer [instantiate var?]]
[sicp-logic.db :as db]
[sicp-logic.evaluator :refer [qeval]]))
(defn contract-question-mark [v]
(symbol
(str "?"
(second v))))
(defn map-over-symbols [proc exp]
(cond
(and (sequential? exp) (not (... | null | https://raw.githubusercontent.com/jdormit/sicp-logic/56ae0fc344d3fce943dcc740a64d3eebc82062d1/src/sicp_logic/core.clj | clojure | (ns sicp-logic.core
(:require [sicp-logic.binding :refer [instantiate var?]]
[sicp-logic.db :as db]
[sicp-logic.evaluator :refer [qeval]]))
(defn contract-question-mark [v]
(symbol
(str "?"
(second v))))
(defn map-over-symbols [proc exp]
(cond
(and (sequential? exp) (not (... | |
a139a4112c32ce447b29fb2aa83b36ca65bf2e5ab16a82b2e5f5a3906ac694b5 | matthias-margush/aka | main.clj | (ns aka.main
"Conveniences for managing tools.deps aliases."
(:refer-clojure :exclude [alias])
(:require [aka.cmd :as cmd]
[aka.taps :as t]))
(defn -main
""
[& [cmd & args]]
(let [taps (t/registry)
cmd (cmd/->aka cmd)]
(cmd/run cmd taps args)))
| null | https://raw.githubusercontent.com/matthias-margush/aka/7c71bbe48aa3429a69401ad0ca9ee6361907732b/src/aka/main.clj | clojure | (ns aka.main
"Conveniences for managing tools.deps aliases."
(:refer-clojure :exclude [alias])
(:require [aka.cmd :as cmd]
[aka.taps :as t]))
(defn -main
""
[& [cmd & args]]
(let [taps (t/registry)
cmd (cmd/->aka cmd)]
(cmd/run cmd taps args)))
| |
a7ff726b96ddfc91d3f59f3a6a7a3381588f61df8a7232fe2e9d853da9b1e513 | tilk/vocoder | Filter.hs | |
Module : Vocoder . Conduit . Filter
Description : Frequency - domain filters in Conduit
Copyright : ( c ) , 2021
License : BSD2
This module defines some useful frequency - domain filters as conduits .
It includes convenience wrappers for filters defined in the vocoder pack... | null | https://raw.githubusercontent.com/tilk/vocoder/540d489d87fdb5d0cdc0ee4e0bd7df774f734d47/vocoder-conduit/src/Vocoder/Conduit/Filter.hs | haskell | # LANGUAGE RankNTypes #
| Conduit frequency-domain filter type. A conduit filter extends
basic frequency-domain filters by using a conduit instead of a
pure function. This enables time transformation filters.
| Identity filter
| Sequential filter composition.
| Use a basic frequency-domain filter as a condui... | |
Module : Vocoder . Conduit . Filter
Description : Frequency - domain filters in Conduit
Copyright : ( c ) , 2021
License : BSD2
This module defines some useful frequency - domain filters as conduits .
It includes convenience wrappers for filters defined in the vocoder pack... |
360351b539b24a70a22f789c38a186968ad28030d25c2d3b622c803dd1ab6b2c | opencog/pln | back-predictive-implication-scope-conditional-conjunction-introduction.scm | ;; BackPredictiveImplicationScope Conditional Conjuntion Introduction Rule
;;
;; This rule is similar to a conjunction introduction rule with an
;; extra condition (more specifically the antecedent of a predictive
;; implication). Its compact notation is:
;;
;; P↝Q
;; P↝R
;; ⊢
;; P↝(Q∧R)
;;
Its Atomese notation is :... | null | https://raw.githubusercontent.com/opencog/pln/5c1b8401b32d54e221e783338596e85d53d3793b/opencog/pln/rules/temporal/back-predictive-implication-scope-conditional-conjunction-introduction.scm | scheme | BackPredictiveImplicationScope Conditional Conjuntion Introduction Rule
This rule is similar to a conjunction introduction rule with an
extra condition (more specifically the antecedent of a predictive
implication). Its compact notation is:
P↝Q
P↝R
⊢
P↝(Q∧R)
V
T
P
Q
BackPredictiveImplicationSc... | Its Atomese notation is :
BackPredictiveImplicationScope < >
where TV is calculated using TV1 and TV2 ( their product assuming
(use-modules (opencog))
(use-modules (opencog exec))
(use-modules (opencog spacetime))
(use-modules (opencog ure))
(use-modules (opencog pln))
(use-modules (opencog logger))
(define ba... |
aac1fde2346776f7f94d8958cc874dd78a1434ee9a0085de2999fb3a7a8cc417 | eugeneia/athens | helper.lisp | (in-package :cl-user)
(defpackage cl-annot.helper
(:nicknames :annot.helper)
(:use :cl
:annot.util
:annot.core
:annot.syntax)
(:export :defannotation
:annotation))
(in-package :annot.helper)
(defun set-annotation-options (name options)
(when (getf options :alias)
(setf (a... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/cl-annot-20150608-git/src/main/helper.lisp | lisp | (in-package :cl-user)
(defpackage cl-annot.helper
(:nicknames :annot.helper)
(:use :cl
:annot.util
:annot.core
:annot.syntax)
(:export :defannotation
:annotation))
(in-package :annot.helper)
(defun set-annotation-options (name options)
(when (getf options :alias)
(setf (a... | |
fb0146c94df39d64083bcc2e63ff42fbcc2098e28c33bb2b86b100365cb7efa6 | geophf/1HaskellADay | Exercise.hs | module Y2018.M02.D14.Exercise where
-- I'm thinking of a word that has the letter 'v' in it, for some strange reason
import Y2018.M02.D01.Exercise
-
So from the above import , we have sets of words associated with a hash . This
hash is the product of their letters - as - primes . AND we know which letter is
wh... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M02/D14/Exercise.hs | haskell | I'm thinking of a word that has the letter 'v' in it, for some strange reason
}
---------------------------------------------------------------
} | module Y2018.M02.D14.Exercise where
import Y2018.M02.D01.Exercise
-
So from the above import , we have sets of words associated with a hash . This
hash is the product of their letters - as - primes . AND we know which letter is
which prime :
> > > primes ! ' A '
2
Voila !
So , given our anagramSets ... |
4cb1675c1b0ac607191f9039b7a95bcfd0c305f5e796a2dd979cb8a76c0e0246 | exoscale/clojure-kubernetes-client | v1_persistent_volume_claim_status.clj | (ns clojure-kubernetes-client.specs.v1-persistent-volume-claim-status
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-persistent-volume-claim-condition :refer :all]
)
(:import (java.io File)))
(declare v1-persistent-volume-... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_persistent_volume_claim_status.clj | clojure | (ns clojure-kubernetes-client.specs.v1-persistent-volume-claim-status
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-persistent-volume-claim-condition :refer :all]
)
(:import (java.io File)))
(declare v1-persistent-volume-... | |
6f30364253bde35fc88a3f7fee75c8da71e1d0bd2ed83c358d436fdec372030a | well-typed/large-records | R100.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
# OPTIONS_GHC -fplugin = TypeLet -fplugin = Data . Record . Anon . Plugin #
{-# OPTIONS_GHC -fplugin-opt=Data.Record.Anon.Plugin:typelet #-}... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-records-benchmarks/bench/large-anon/Experiment/ConstructWithTypeLet/Sized/R100.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings #
# OPTIONS_GHC -fplugin-opt=Data.Record.Anon.Plugin:typelet #
00 .. 09 | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
# OPTIONS_GHC -fplugin = TypeLet -fplugin = Data . Record . Anon . Plugin #
module Experiment.ConstructWithTypeLet.Sized.R100 where
import Data.Record.Anon.Simple (Record)
import Bench.Types
import Common.RowOfSize.Row100
record :: Word -> Record ExampleRow
rec... |
5debcad9e4abd1c0ec65bf63864ac3937261961996bf508296eb1d86236f154a | ocaml/oasis | c1.mli | (******************************************************************************)
OASIS : architecture for building OCaml libraries and applications
(* *)
Copyright ( C ) 2011 - 2016 ,
Copyrig... | null | https://raw.githubusercontent.com/ocaml/oasis/3d1a9421db92a0882ebc58c5df219b18c1e5681d/test/data/TestPluginOMake/complex/src/libc_/c1.mli | ocaml | ****************************************************************************
This library is free software; you can redistribute it and/or modify it
under the t... | OASIS : architecture for building OCaml libraries and applications
Copyright ( C ) 2011 - 2016 ,
Copyright ( C ) 2008 - 2011 , OCamlCore SARL
the Free Software Foundation ; either version 2.1 of the License , or ( at
You s... |
817e65b9fcf8981558cfb527cc66bfa1067fc568c721fc3f51b081cbc89460c3 | manavpatnaik/haskell | 2.hs | import Data.List
import System.IO
primeNumbers = [3,5,7,11]
morePrime = primeNumbers ++ [13, 17, 19, 23, 29]
-- Another way of constructing lists
favNums = 2 : 7 : 21 : 5 : []
favNumsUpdated = 12 : favNums
-- While using colons the list must be at the end
anotherList = 1 : 4 : 5 : [6,7,8]
multList = [[3,5,7], [1,... | null | https://raw.githubusercontent.com/manavpatnaik/haskell/aceb618af2bbf58e8fa925555053083438f82eb5/learning-modules/2.hs | haskell | Another way of constructing lists
While using colons the list must be at the end
List comprehension | import Data.List
import System.IO
primeNumbers = [3,5,7,11]
morePrime = primeNumbers ++ [13, 17, 19, 23, 29]
favNums = 2 : 7 : 21 : 5 : []
favNumsUpdated = 12 : favNums
anotherList = 1 : 4 : 5 : [6,7,8]
multList = [[3,5,7], [1,2,3]]
lenPrime = length primeNumbers
revPrime = reverse primeNumbers
isListEmpty = n... |
3869ac5ae9e46da9b4a51c465fc90d9deaeb743efeeb1d5b8383aece15ca5ba3 | racket/plai | mutator.rkt | #lang scheme
(require (prefix-in scheme: scheme)
plai/private/command-line
(for-syntax plai/private/command-line)
plai/gc2/private/collector-exports
plai/gc2/private/gc-core
scheme/gui/dynamic
(only-in plai/test-harness
exn:plai? equal~?
... | null | https://raw.githubusercontent.com/racket/plai/164f3b763116fcfa7bd827be511650e71fa04319/plai-lib/gc2/mutator.rkt | racket | Sugar Macros
Real Macros
If this call is in tail position, we will not need access
to its environment when it returns.
If this call is not in tail position, we make the
environment at the call site reachable.
Module Begin
User Macros
XXX make a macro to unify this and provide/lift
We must invoke mutator-app t... | #lang scheme
(require (prefix-in scheme: scheme)
plai/private/command-line
(for-syntax plai/private/command-line)
plai/gc2/private/collector-exports
plai/gc2/private/gc-core
scheme/gui/dynamic
(only-in plai/test-harness
exn:plai? equal~?
... |
5011a51ed92e95f06de17dca98c4c28d14a86552069061ef8ed39889d54a1a81 | marigold-dev/mankavar | scre.ml | [@@@warning "-34"]
(* Take care of gas and bytes *)
type do_operation_result = {
state : unit ;
gas : int64 ;
bytes : int64 ;
}
[@@deriving ez]
open Das_helpers
open Structs
module type STATE = Patricia_state.STATE
module Do_transfer = struct
type continuation = {
input : Transfer.payload ;
storage :... | null | https://raw.githubusercontent.com/marigold-dev/mankavar/13592b5eb888f2ec73816e3d200a6e89228941da/src/consensus/tx-oru/proof-scre/scre.ml | ocaml | Take care of gas and bytes
Format.printf "DO OPERATION@;\n" ; | [@@@warning "-34"]
type do_operation_result = {
state : unit ;
gas : int64 ;
bytes : int64 ;
}
[@@deriving ez]
open Das_helpers
open Structs
module type STATE = Patricia_state.STATE
module Do_transfer = struct
type continuation = {
input : Transfer.payload ;
storage : Eval.memory ;
state : unit D... |
b1b02c0525bc85e76c5c1130393f4ad9f54d6423df538a275ebb0b0b2002bc28 | rsnikhil/Forvis_RISCV-ISA-Spec | Mem_Ops.hs | Copyright ( c ) 2018 - 2019
-- See LICENSE for license details
module Mem_Ops where
-- ================================================================
-- This module defines instruction field values that specify the type
-- and size of memory operations.
Note : these are duplicates of defs in Forvis_Spec.hs ... | null | https://raw.githubusercontent.com/rsnikhil/Forvis_RISCV-ISA-Spec/0c5590a12f4b39644d0497fa6285ad5e33003dfc/src/Mem_Ops.hs | haskell | See LICENSE for license details
================================================================
This module defines instruction field values that specify the type
and size of memory operations.
repeated here because this information is also needed by memory and
I/O servers, and by top-level execution and debug w... | Copyright ( c ) 2018 - 2019
module Mem_Ops where
Note : these are duplicates of defs in Forvis_Spec.hs where they are
used in the specs of LOAD , STORE and AMO instructions . They are
Forvis_Spec.hs could have just imported this module , but these defs
Standard Haskell imports
import Data.Word
impo... |
faedb4f3341a3e4d9c307b455f870185c734d3d2a83fc94c4abe8dc73a3e1f2d | inaka/sumo_db | sumo_changeset_SUITE.erl | -module(sumo_changeset_SUITE).
-compile({parse_transform, fancyflow_trans}).
-include_lib("common_test/include/ct.hrl").
-import(sumo_test_utils, [assert_error/2]).
%% Common Test
-export([
all/0,
init_per_suite/1,
end_per_suite/1
]).
%% Test Cases
-export([
t_add_error/1,
t_cast/1,
t_change/1,
t_put... | null | https://raw.githubusercontent.com/inaka/sumo_db/331ea718c13a01748a7739ad4078b0032f4d32e5/test/sumo_changeset_SUITE.erl | erlang | Common Test
Test Cases
=============================================================================
CT
=============================================================================
=============================================================================
Test Cases
=============================================... | -module(sumo_changeset_SUITE).
-compile({parse_transform, fancyflow_trans}).
-include_lib("common_test/include/ct.hrl").
-import(sumo_test_utils, [assert_error/2]).
-export([
all/0,
init_per_suite/1,
end_per_suite/1
]).
-export([
t_add_error/1,
t_cast/1,
t_change/1,
t_put_change/1,
t_get_change/1,
... |
67f624ade0032f62f92657c7fa29f7288fe1fb9fd594d2be0a51e68ca880c9fe | buntine/Haskell--Craft-of-FP | Chapter3.hs | ------------------------------------------------------------------------------
--
Haskell : The Craft of Functional Programming
( c ) Addison - Wesley , 1999 .
--
Chapter 3
--
------------------------------------------------------------------------------
module Chapter3 where
The import statement which fo... | null | https://raw.githubusercontent.com/buntine/Haskell--Craft-of-FP/a1a8cd70eb9d1609fd384e608b7fe26b2a878803/Chapter3.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
so that they can be given the definitions they have in their book.
^^^^^^^^^^^^^
Exclusive or: this gives the result True if one of its arguments is True and
t... | Haskell : The Craft of Functional Programming
( c ) Addison - Wesley , 1999 .
Chapter 3
module Chapter3 where
The import statement which follows hides certain of the Prelude functions
import Prelude hiding (max,toUpper,isDigit)
The Booleans .
exOr :: Bool -> Bool -> Bool
exOr x y = (x || y) && not ... |
e2abe6966ec03561dd0a80d0e7c91bd902d599377874478ccd33d4019148203b | jrh13/hol-light | struct_equal.ml | (******************************************************************************)
(* FILE : struct_equal.ml *)
DESCRIPTION : Proof procedure for simplifying an equation between two
(* data-structures of the same type. *... | null | https://raw.githubusercontent.com/jrh13/hol-light/ea44a4cacd238d7fa5a397f043f3e3321eb66543/Boyer_Moore/struct_equal.ml | ocaml | ****************************************************************************
FILE : struct_equal.ml
data-structures of the same type.
READS FILES... | DESCRIPTION : Proof procedure for simplifying an equation between two
AUTHOR : R.J.Boulton & T.F.Melham
DATE : 4th June 1992
LAST MODIFIED : R.J.Boulton
DAT... |
c535c029be204fe3e7b6231e053eff5e1db021e64432d01007abf6e578d532fd | Introduction-to-Functional-Programming/simple_exercises | rna_transcription.erl | -module(rna_transcription).
-export([to_rna/1]).
to_rna([]) ->
[];
to_rna(Strand) ->
RnaMap = #{$A => $U, $C => $G, $G => $C, $T => $A},
lists:map(fun (X) ->
maps:get(X, RnaMap)
end,
Strand).
| null | https://raw.githubusercontent.com/Introduction-to-Functional-Programming/simple_exercises/674cc97ac01df41179fdd9a7af0743f6dfa0f780/adolfont/exercism/erlang/rna-transcription/src/rna_transcription.erl | erlang | -module(rna_transcription).
-export([to_rna/1]).
to_rna([]) ->
[];
to_rna(Strand) ->
RnaMap = #{$A => $U, $C => $G, $G => $C, $T => $A},
lists:map(fun (X) ->
maps:get(X, RnaMap)
end,
Strand).
| |
1bc9a33dcda22e7c9d2f591c84c604d2bb232e45c43bc82adcbacad4eb859577 | bdeket/rktsicm | mathutil.rkt | #lang racket/base
(provide (all-defined-out)
(all-from-out "cstm/mathutil.rkt")
g:identity)
(require (only-in "../rkt/glue.rkt" cons*)
(only-in "../rkt/define.rkt" define default-object?)
(only-in racket/syntax format-id)
"../general/list-utils.rkt"
"cstm/make-pla... | null | https://raw.githubusercontent.com/bdeket/rktsicm/4ac66a098189ec80091422050bc48d443b68a41d/rktsicm/sicm/kernel/mathutil.rkt | racket | ; start original file
not sure ... should this be exact?
See numbers.scm
; moved to cstm / generic 11
The generalized selector:
; moved to cstm / mathutil 1
; moved to cstm / mathutil 2
; moved to cstm / generic 10
| #lang racket/base
(provide (all-defined-out)
(all-from-out "cstm/mathutil.rkt")
g:identity)
(require (only-in "../rkt/glue.rkt" cons*)
(only-in "../rkt/define.rkt" define default-object?)
(only-in racket/syntax format-id)
"../general/list-utils.rkt"
"cstm/make-pla... |
f5eec9dfd3e3ce0d600a4e36f99a2f8b1beb49f08eb7ef235ea5cbc536427956 | arcusfelis/xapian-erlang-bindings | xapian.erl | @headerfile " xapian.hrl "
-module(xapian).
-export([start/0]).
-include_lib("xapian/include/xapian.hrl").
start() ->
application:start(xapian).
| null | https://raw.githubusercontent.com/arcusfelis/xapian-erlang-bindings/29871b3e64d658e74701c6ba68bf59e1a9b168f1/src/xapian.erl | erlang | @headerfile " xapian.hrl "
-module(xapian).
-export([start/0]).
-include_lib("xapian/include/xapian.hrl").
start() ->
application:start(xapian).
| |
aed34e6905ea3fc6b1aae7e2c43864ad8a18f01b39cd74ac28ae22196c023372 | phmarek/yason | parse.lisp | This file is part of yason , a Common Lisp JSON parser / encoder
;;
Copyright ( c ) 2008 - 2014 and contributors
;; All rights reserved.
;;
;; Please see the file LICENSE in the distribution.
(in-package :yason)
(defconstant +default-string-length+ 20
"Default length of strings that are created while reading ... | null | https://raw.githubusercontent.com/phmarek/yason/f4ad893e9dc4142396a86bc518ff6bc814fd43da/parse.lisp | lisp |
All rights reserved.
Please see the file LICENSE in the distribution.
would be
(cl-ppcre:scan-to-strings "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+|)(?:[eE][-+]?[0-9]+|)" buffer)
but we want to operate on streams
surrogate chars as is.
Uses hash-table
backward compatibility code
end of backward compatibility code | This file is part of yason , a Common Lisp JSON parser / encoder
Copyright ( c ) 2008 - 2014 and contributors
(in-package :yason)
(defconstant +default-string-length+ 20
"Default length of strings that are created while reading json input.")
(declaim (type symbol true))
(defvar true 'true
"Symbol represent... |
ccc9addfac39ea720c12093da9aed1917fba1ee8994aa6fce4a5e3f70d68a7cf | VisionsGlobalEmpowerment/webchange | handler.clj | (ns webchange.test.accounts.handler
(:require [clojure.test :refer :all]
[ring.mock.request :as mock]
[webchange.test.fixtures.core :as f]
[webchange.handler :as handler]
[mount.core :as mount]
[clojure.data.json :as json]
[clojure.tools.logging ... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/9ecee6f21e264cb41fc128754f2256ea98e79f9d/test/clj/webchange/test/accounts/handler.clj | clojure | (ns webchange.test.accounts.handler
(:require [clojure.test :refer :all]
[ring.mock.request :as mock]
[webchange.test.fixtures.core :as f]
[webchange.handler :as handler]
[mount.core :as mount]
[clojure.data.json :as json]
[clojure.tools.logging ... | |
8333f72fe34c97629787adb225aa071fe528e10540562ba11c7050a361162c8f | ocaml-batteries-team/batteries-included | batEnum.mli |
* - enumeration over abstract collection of elements .
* Copyright ( C ) 2003
* 2009 , LIFO , Universite d'Orleans
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free... | null | https://raw.githubusercontent.com/ocaml-batteries-team/batteries-included/f143ef5ec583d87d538b8f06f06d046d64555e90/src/batEnum.mli | ocaml | * A signature for data structures which may be converted to and from [enum].
If you create a new data structure, you should make it compatible
with [Enumerable].
* The data structure, e.g. ['a List.t]
* Return an enumeration of the elements of the data structure
* Build a data structure from an enumeration ... |
* - enumeration over abstract collection of elements .
* Copyright ( C ) 2003
* 2009 , LIFO , Universite d'Orleans
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free... |
3def62fc3373de040d548ea38c2b3928a8c4fa369d6a7ad27dc0b172290bec58 | flodihn/NextGen | shared_cache.erl | -module(shared_cache).
-export([
init/0,
store/2,
retr/1
]).
init() ->
ets:new(?MODULE, [named_table, public]).
store(Key, Val) ->
ets:insert(?MODULE, {Key, Val}).
retr(Key) ->
case ets:lookup(?MODULE, Key) of
[{Key, Val}] ->
Val;
[] ->
undefined
... | null | https://raw.githubusercontent.com/flodihn/NextGen/3da1c3ee0d8f658383bdf5fccbdd49ace3cdb323/AreaServer/src/shared_cache.erl | erlang | -module(shared_cache).
-export([
init/0,
store/2,
retr/1
]).
init() ->
ets:new(?MODULE, [named_table, public]).
store(Key, Val) ->
ets:insert(?MODULE, {Key, Val}).
retr(Key) ->
case ets:lookup(?MODULE, Key) of
[{Key, Val}] ->
Val;
[] ->
undefined
... | |
ef6b6d8e8c7f21227fe9819fa9910387846c39f93faef9ba177d1bbe73af465b | disco-framework/disco | test_helpers.erl | %% @hidden to edoc
-module(test_helpers).
-export([
unconsult/2,
calls_of/2,
times_called/2
]).
-spec unconsult(file:name(), [term()]) -> ok.
unconsult(File,Terms) ->
{ok, Handle} = file:open(File, [write]),
lists:foreach( fun(X) -> io:format(Handle, "~p.~n",[X]) en... | null | https://raw.githubusercontent.com/disco-framework/disco/f55f35d46d43ef5f4fa1466bdf8d662f5f01f30f/src/test/test_helpers.erl | erlang | @hidden to edoc |
-module(test_helpers).
-export([
unconsult/2,
calls_of/2,
times_called/2
]).
-spec unconsult(file:name(), [term()]) -> ok.
unconsult(File,Terms) ->
{ok, Handle} = file:open(File, [write]),
lists:foreach( fun(X) -> io:format(Handle, "~p.~n",[X]) end, Terms),
... |
291f66f781337e38d8e067eef05095fac28e24b89ba71a5841eb8cdf0617e8ef | dsheets/codoc | codocCliExtract.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/dsheets/codoc/382077cf3e7e20e478bd97cc0b348e0b2ec926db/cli/codocCliExtract.ml | ocaml | TODO: support packs
TODO: Use index caching?
Creating *or* updating index so no need to check for force
TODO: use index caching?
Creating *or* updating index so no need to check for force
simple doc gen |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
d4d0ba4fe77bd07fa79924db79e4f1efb8318e4c316804520e0112b8c9add16f | McParen/croatoan | color.lisp | (in-package :de.anvi.ncurses)
;;; color
;;; curses color manipulation routines
;;; -island.net/ncurses/man/curs_color.3x.html
;;;
;;; C prototypes
int start_color(void ) ;
;; bool has_colors(void);
;; bool can_change_color(void);
;; int init_pair(short pair, short f, short b);
;; int init_color(short color, sho... | null | https://raw.githubusercontent.com/McParen/croatoan/89014b041ff6d17005fa4e5210f9360a96550fdb/ncurses/color.lisp | lisp | color
curses color manipulation routines
-island.net/ncurses/man/curs_color.3x.html
C prototypes
bool has_colors(void);
bool can_change_color(void);
int init_pair(short pair, short f, short b);
int init_color(short color, short r, short g, short b);
int pair_content(short pair, short *f, short *b);
int col... | (in-package :de.anvi.ncurses)
(cffi:defcfun ("start_color" start-color) :int)
(cffi:defcfun ("has_colors" has-colors) :boolean)
(cffi:defcfun ("can_change_color" can-change-color) :boolean)
(cffi:defcfun ("init_pair" init-pair) :int (pair :short) (f :short) (b :short))
(cffi:d... |
98bde824695f5d911a9fae1b40cab4b6d7450747320c31e399a9b019d3cb0eae | kawasima/jagrid | index.clj | (ns jagrid.example.index
(:use [hiccup.core]
[jagrid.example.layout]))
(defn view []
(view-layout {:title "index"}
[:h1 "Excel方眼紙のようなレイアウトを実現します"]
[:ul
[:li [:a {:href "basic.html"} "Excel方眼紙レイアウトの基本"]]
[:li [:a {:href "sales-report.html"} "組み合わせた例 (営業日報)"]]]))
| null | https://raw.githubusercontent.com/kawasima/jagrid/524b351c47ba2648f96ce8ef5ee431d0eb594d28/src/jagrid/example/index.clj | clojure | (ns jagrid.example.index
(:use [hiccup.core]
[jagrid.example.layout]))
(defn view []
(view-layout {:title "index"}
[:h1 "Excel方眼紙のようなレイアウトを実現します"]
[:ul
[:li [:a {:href "basic.html"} "Excel方眼紙レイアウトの基本"]]
[:li [:a {:href "sales-report.html"} "組み合わせた例 (営業日報)"]]]))
| |
cfc6e8c49ca87d787ee8cb95cab29ed89093dc888f099e8be3c577d2cf64e317 | TerrorJack/ghc-alter | Pack.hs | # LANGUAGE Unsafe #
# LANGUAGE NoImplicitPrelude , MagicHash , UnboxedTuples #
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Pack
Copyright : ( c ) The University of Glasgow 1997 - 2002
-- License : see libraries/base/L... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/GHC/Pack.hs | haskell | # OPTIONS_HADDOCK hide #
---------------------------------------------------------------------------
|
Module : GHC.Pack
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
This module provides a small set of low-level functions for packing
and unpacking a chunk of bytes. Us... | # LANGUAGE Unsafe #
# LANGUAGE NoImplicitPrelude , MagicHash , UnboxedTuples #
Copyright : ( c ) The University of Glasgow 1997 - 2002
Portability : non - portable ( GHC Extensions )
The programmer level view of packed strings is provided by a GHC
system library PackedString .
module GHC.Pack
(
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.