_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 |
|---|---|---|---|---|---|---|---|---|
6cc1a94f54c09732ef11f6749129284e833ccc4d5797e586729e7e184e9cc309 | ChesleyTan/ascii-chat | messaging.ml | open Package
open Cv
(* History buffer stored as a list *)
let history_buffer: string list ref = ref []
(* Hashtable for keeping track of timestamp of last messages for each user *)
let message_mapping = Hashtbl.create 1
(* Take user identity (ip address + port), a message, and a timestamp as input,
* and populate ... | null | https://raw.githubusercontent.com/ChesleyTan/ascii-chat/f2670c4a9d8b8e555d6b42741b314257db942c30/src/messaging.ml | ocaml | History buffer stored as a list
Hashtable for keeping track of timestamp of last messages for each user
Take user identity (ip address + port), a message, and a timestamp as input,
* and populate an internal buffer that represents the accumulated chat
* history, which should only be updated when a new message is... | open Package
open Cv
let history_buffer: string list ref = ref []
let message_mapping = Hashtbl.create 1
let add_to_history_buffer user package =
let (_, text, _, _) = unpack package in
history_buffer :=
!history_buffer @
[ user
^ ": "
^ text
]
let re... |
23110153f757472e3b93ad3a5932d6e6ee09ea02cdf9480042e52e4c6546491f | EveryTian/Haskell-Codewars | rot13-2.hs | -- -2
module ROT13 where
import Data.Char (chr, ord)
rot13 :: String -> String
rot13 = let f :: Char -> Char
f c
| elem c ['a'..'z'] = let c' = chr (ord c + 13)
in if c' > 'z' then chr (ord c' - 26) else c'
| otherwise = c
in map f
| null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/7kyu/rot13-2.hs | haskell | -2 |
module ROT13 where
import Data.Char (chr, ord)
rot13 :: String -> String
rot13 = let f :: Char -> Char
f c
| elem c ['a'..'z'] = let c' = chr (ord c + 13)
in if c' > 'z' then chr (ord c' - 26) else c'
| otherwise = c
in map f
|
34b320f56f8e4cfe3264b56f483fbd66e638b43ed24e9919074ae95a8bf4ed67 | tonyvanriet/clj-slack-client | dnd.clj | (ns clj-slack-client.dnd
(:require [clj-slack-client.web :as web]))
(defn- cast-int [s]
"Pick out an integer from a string, or returns the number passed."
(if (number? s)
s
(Integer. (re-find #"\d+" s))))
(defn time-difference
"Given two time stamps, returns a hashmap with atoms :min and :sec
giving... | null | https://raw.githubusercontent.com/tonyvanriet/clj-slack-client/6783f003ab93adae057890421622eb5e61ab033d/src/clj_slack_client/dnd.clj | clojure | These methods require a non-bot api-token. These have been written
in the hopes that these methods will be accessible in the future. | (ns clj-slack-client.dnd
(:require [clj-slack-client.web :as web]))
(defn- cast-int [s]
"Pick out an integer from a string, or returns the number passed."
(if (number? s)
s
(Integer. (re-find #"\d+" s))))
(defn time-difference
"Given two time stamps, returns a hashmap with atoms :min and :sec
giving... |
8533e5c6ae74f1518ca50e557db06e693da61a36e22097889df1c945ecebfad7 | spartango/CS153 | cfg_gen.ml | open Io_types
open Cfg_ast
open Utility
exception InvalidLabel
exception FailedStabilization
exception InvalidControlFlow
exception InvalidMoveRelated
let run_until_stable t_func init_arg limit =
let rec until_stable arg count =
if count >= limit then raise FailedStabilization
else
let out = t_func a... | null | https://raw.githubusercontent.com/spartango/CS153/16faf133889f1b287cb95c1ea1245d76c1d8db49/ps7/cfg_gen.ml | ocaml | Block does not end in control flow statement
Builds a set from a list of operands
Builds a new io_inst record with reads rs and writes ws
Builds the In/Out sets for each instruction. block_out is the Out set for the final instruction
next_ins holds state
Builds In/Out sets for each instruction where the Out ... | open Io_types
open Cfg_ast
open Utility
exception InvalidLabel
exception FailedStabilization
exception InvalidControlFlow
exception InvalidMoveRelated
let run_until_stable t_func init_arg limit =
let rec until_stable arg count =
if count >= limit then raise FailedStabilization
else
let out = t_func a... |
5466c4a725f5412860701fa2bb798d467c2612309ddd7477da52244fd92dd3ab | BranchTaken/Hemlock | cmpable.ml | open CmpableIntf
module Make (T : IMono) : SMono with type t := T.t = struct
include T
let ( >= ) t0 t1 =
match T.cmp t0 t1 with
| Lt -> false
| Eq
| Gt -> true
let ( <= ) t0 t1 =
match T.cmp t0 t1 with
| Lt
| Eq -> true
| Gt -> false
let ( = ) t0 t1 =
match T.cmp t0 t1 w... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/61c3d1aa744b8976385aa4574e30b958e95d7f2d/bootstrap/src/basis/cmpable.ml | ocaml | open CmpableIntf
module Make (T : IMono) : SMono with type t := T.t = struct
include T
let ( >= ) t0 t1 =
match T.cmp t0 t1 with
| Lt -> false
| Eq
| Gt -> true
let ( <= ) t0 t1 =
match T.cmp t0 t1 with
| Lt
| Eq -> true
| Gt -> false
let ( = ) t0 t1 =
match T.cmp t0 t1 w... | |
9e23ebcc71d7999ce505151174e26fbdf158f5477614cba8a2ccdff3ac6355dc | lixiangqi/medic | trace-util.rkt | #lang racket
(provide add-log
add-node
add-edge
delete-node
delete-edge
record-aggregate
record-timeline
record-changed
record-start-time
get-log-data
get-raw-graph
get-aggregate-data
get-timeline-data
... | null | https://raw.githubusercontent.com/lixiangqi/medic/0920090d3c77d6873b8481841622a5f2d13a732c/trace-util.rkt | racket | check equality of all public and private fields
check equality of all public and inherited fields | #lang racket
(provide add-log
add-node
add-edge
delete-node
delete-edge
record-aggregate
record-timeline
record-changed
record-start-time
get-log-data
get-raw-graph
get-aggregate-data
get-timeline-data
... |
1167910a163f6744645e89dcb1c654a9306c66b89732d8cf919d4396f3128403 | richhickey/clojure-contrib | condition.clj | Copyright ( c ) . All rights reserved . The use and
;; distribution terms for this software are covered by the Eclipse Public
;; License 1.0 (-1.0.php) which can
;; be found in the file epl-v10.html at the root of this distribution. By
;; using this software in any fashion, you are agreeing to be bound by ... | null | https://raw.githubusercontent.com/richhickey/clojure-contrib/40b960bba41ba02811ef0e2c632d721eb199649f/src/main/clojure/clojure/contrib/condition.clj | clojure | distribution terms for this software are covered by the Eclipse Public
License 1.0 (-1.0.php) which can
be found in the file epl-v10.html at the root of this distribution. By
using this software in any fashion, you are agreeing to be bound by the
terms of this license. You must not remove this notice, or an... | Copyright ( c ) . All rights reserved . The use and
scgilardi ( gmail )
Created 09 June 2009
(ns #^{:author "Stephen C. Gilardi"
:doc "Flexible raising and handling of conditions:
Functions:
raise: raises a condition
handler-case: dispatches raised conditions to appropriate ... |
14e65fc9e98396e002e3f0aa52011b532fc97741f0165614fb9717514e63e6c6 | vseloved/rutils | array-test.lisp | ;;;;; Test suite for RUTILS LIST
;;;;; see LICENSE file for permissions
(cl:in-package #:rutils.test)
(named-readtables:in-readtable rutils-readtable)
(deftest slice ()
(should be string= "foo"
(slice "foo" 0))
(should be string= "foo"
(slice "foo" 0 3))
(should be string= "f"
(s... | null | https://raw.githubusercontent.com/vseloved/rutils/db3c3f4ae897025b5f0cd81042ca147da60ca0c5/test/array-test.lisp | lisp | Test suite for RUTILS LIST
see LICENSE file for permissions |
(cl:in-package #:rutils.test)
(named-readtables:in-readtable rutils-readtable)
(deftest slice ()
(should be string= "foo"
(slice "foo" 0))
(should be string= "foo"
(slice "foo" 0 3))
(should be string= "f"
(slice "foo" 0 1))
(should be blankp
(slice "foo" 3 3)))
(def... |
ecd001de55ce09bc9dac1bc2867d46d17545c5f7e42f89e6bf9bc2d3b9ad3cc7 | evmar/c-repl | GCCXML.hs | -- c-repl: a C read-eval-print loop.
Copyright ( C ) 2008 < >
-- This module parses GCCXML output, giving you a parse tree of C code.
module GCCXML (
Symbol(..),
-- The main parser/driver, @symbols code@ returns either an error or a list of
-- resolved Symbols.
symbols,
-- Print a user-friendly versi... | null | https://raw.githubusercontent.com/evmar/c-repl/623684ad7a2d647b00d26b9d40f77d3754b91c9d/GCCXML.hs | haskell | c-repl: a C read-eval-print loop.
This module parses GCCXML output, giving you a parse tree of C code.
The main parser/driver, @symbols code@ returns either an error or a list of
resolved Symbols.
Print a user-friendly version of a Symbol.
or an error string on error.
and pointers to other nodes. While parsing,... | Copyright ( C ) 2008 < >
module GCCXML (
Symbol(..),
symbols,
showSymbol
) where
import Prelude hiding (catch)
import Control.Monad.Error
import Control.Exception
import qualified Data.ByteString as BS
import Data.Maybe (mapMaybe)
import Data.List (intercalate)
import qualified Data.Map as M
import Syst... |
cf60a4e2b523ef20aab5ab54bcce2ba7ec927606a6d5dbf2ad22aec56f4a73ac | stuarthalloway/programming-clojure | snake.clj | ; Inspired by the snakes that have gone before:
snake : -smaller-snake/
snake :
The START:/END : pairs are production artifacts for the book and not
part of normal Clojure style
(ns examples.snake
(:import (java.awt Color Dimension)
(javax.swing JPanel JFrame Timer JOptionPane)
(java.... | null | https://raw.githubusercontent.com/stuarthalloway/programming-clojure/192e2f28d797fd70e50778aabd031b3ff55bd2b9/src/examples/snake.clj | clojure | Inspired by the snakes that have gone before:
----------------------------------------------------------
functional model
----------------------------------------------------------
END: constants
END: board math
END: apple
END: snake
END: move
END: turn
END: win?
END: lose?
END: eats?
--------------------... | snake : -smaller-snake/
snake :
The START:/END : pairs are production artifacts for the book and not
part of normal Clojure style
(ns examples.snake
(:import (java.awt Color Dimension)
(javax.swing JPanel JFrame Timer JOptionPane)
(java.awt.event ActionListener KeyListener))
(:use e... |
86a6f714186fd2deb7edd6bffe5e0c455f954e085f76d3b4e0e7cb32cee2d9e5 | ku-fpg/kansas-lava | Enabled.hs | # LANGUAGE ScopedTypeVariables , FlexibleContexts , TypeFamilies ,
TypeSynonymInstances , FlexibleInstances , GADTs , RankNTypes ,
UndecidableInstances #
TypeSynonymInstances, FlexibleInstances, GADTs, RankNTypes,
UndecidableInstances #-}
-- | The 'Enabled' module allows the construction of circui... | null | https://raw.githubusercontent.com/ku-fpg/kansas-lava/cc0be29bd8392b57060c3c11e7f3b799a6d437e1/Language/KansasLava/Protocols/Enabled.hs | haskell | | The 'Enabled' module allows the construction of circuits that use
additional control logic -- an enable signal -- that externalizes whether a
data signal is valid.
| Enabled is a synonym for Maybe.
passed on assumes no history, in the 'a -> b' function.
| Lift a data signal to be an Enabled signal, that's alway... | # LANGUAGE ScopedTypeVariables , FlexibleContexts , TypeFamilies ,
TypeSynonymInstances , FlexibleInstances , GADTs , RankNTypes ,
UndecidableInstances #
TypeSynonymInstances, FlexibleInstances, GADTs, RankNTypes,
UndecidableInstances #-}
module Language.KansasLava.Protocols.Enabled
(Enabled,
... |
1d8646945f3d8c5ff35dc87bda1b4398ad4f03619be022dd187aa4d8ab03da2e | robrix/sequoia | Subtraction.hs | module Sequoia.Connective.Subtraction
( -- * Subtraction
Sub(..)
, type (>-)
, type (-~)
-- * Elimination
, runSubCoexp
, appSub
-- * Optics
, subA_
, subK_
) where
import Data.Kind (Type)
import Data.Profunctor
import Fresnel.Lens
import Sequoia.Polarity
import ... | null | https://raw.githubusercontent.com/robrix/sequoia/592b87cd901475dd1363760ac3ebc30d980c609b/src/Sequoia/Connective/Subtraction.hs | haskell | * Subtraction
* Elimination
* Optics
Subtraction
Elimination | module Sequoia.Connective.Subtraction
Sub(..)
, type (>-)
, type (-~)
, runSubCoexp
, appSub
, subA_
, subK_
) where
import Data.Kind (Type)
import Data.Profunctor
import Fresnel.Lens
import Sequoia.Polarity
import Sequoia.Profunctor.Continuation
import qualified Seq... |
476fc62b5dc9aab6d5e7958009080cacd22d6f570b3bcc794b9102c9fd7585b7 | restyled-io/restyled.io | Lens.hs | module Yesod.Core.Types.Lens
( envL
, siteL
) where
import Prelude
import Lens.Micro (Lens', lens)
import Yesod.Core.Types (HandlerData(..), RunHandlerEnv(..))
envL :: Lens' (HandlerData child site) (RunHandlerEnv child site)
envL = lens handlerEnv $ \x y -> x { handlerEnv = y }
siteL :: Lens' (RunHandl... | null | https://raw.githubusercontent.com/restyled-io/restyled.io/f9f34b6ad572d2c9ee5689367329916e65596581/src/Yesod/Core/Types/Lens.hs | haskell | module Yesod.Core.Types.Lens
( envL
, siteL
) where
import Prelude
import Lens.Micro (Lens', lens)
import Yesod.Core.Types (HandlerData(..), RunHandlerEnv(..))
envL :: Lens' (HandlerData child site) (RunHandlerEnv child site)
envL = lens handlerEnv $ \x y -> x { handlerEnv = y }
siteL :: Lens' (RunHandl... | |
611c2faa80e2065422fa0adc4f83fdd41a8f146fa0af252f8ea1df1b9e8d8cc4 | ksrky/Plato | Monad.hs | # LANGUAGE MultiParamTypeClasses #
module Plato.Parsing.Monad where
import Plato.Types.Fixity
import Plato.Types.Name
import Control.Exception.Safe
import Control.Monad.State.Class
import Control.Monad.Trans
import qualified Data.ByteString.Internal as BS
import qualified Data.Map.Strict as M
import qualified Data.T... | null | https://raw.githubusercontent.com/ksrky/Plato/02b1a043efa92cf2093ff7d721a607d8abe9d876/src/Plato/Parsing/Monad.hs | haskell | --------------------------------------------------------------
Basic interface
--------------------------------------------------------------
current position,
previous char
rest of the bytes for the current char
current input string
--------------------------------------------------------------
------------------... | # LANGUAGE MultiParamTypeClasses #
module Plato.Parsing.Monad where
import Plato.Types.Fixity
import Plato.Types.Name
import Control.Exception.Safe
import Control.Monad.State.Class
import Control.Monad.Trans
import qualified Data.ByteString.Internal as BS
import qualified Data.Map.Strict as M
import qualified Data.T... |
6805fd8491a817098ed2fa43952940c8f5cbecb1b5b0f517101538d0ccec5182 | greghendershott/vestige | forms.rkt | #lang racket/base
(require (for-syntax racket/base
racket/match
(only-in racket/syntax format-id)
syntax/parse/lib/function-header
"infer-name.rkt" ;not syntax/name
"srcloc.rkt")
syntax/parse/define
... | null | https://raw.githubusercontent.com/greghendershott/vestige/ee7f0b35ba5e5d1a3e5ec90976c658bce24d0ba4/vestige-lib/vestige/private/tracing/forms.rkt | racket | not syntax/name
NOTE: These surface macros are fairly different from racket/trace.
We don't support mutating definitions with `trace` and `untrace`.
form here is trace-lambda.
Give the lambda expression the srcloc from this-syntax so that
e.g. check-syntax tail reporting points to user's source not
here. (Macros ... | #lang racket/base
(require (for-syntax racket/base
racket/match
(only-in racket/syntax format-id)
syntax/parse/lib/function-header
"srcloc.rkt")
syntax/parse/define
"../logging/app.rkt"
"wrap.rkt")
Instead... |
23b1402df7e52c94807068eee0588d17b1738c05a05329ef6f4236a2d3f03f1f | nunchaku-inria/nunchaku | Trans_ho_fo.mli |
(* This file is free software, part of nunchaku. See file "license" for more details. *)
* { 1 Conversion HO / FO }
open Nunchaku_core
module Of_ho(T_ho : TermInner.FULL) : sig
exception NotInFO of string
val convert_problem :
(T_ho.t,T_ho.t) Problem.t ->
(FO.T.t,FO.Ty.t) FO.Problem.t
* Conversion of p... | null | https://raw.githubusercontent.com/nunchaku-inria/nunchaku/16f33db3f5e92beecfb679a13329063b194f753d/src/transformations/Trans_ho_fo.mli | ocaml | This file is free software, part of nunchaku. See file "license" for more details. |
* { 1 Conversion HO / FO }
open Nunchaku_core
module Of_ho(T_ho : TermInner.FULL) : sig
exception NotInFO of string
val convert_problem :
(T_ho.t,T_ho.t) Problem.t ->
(FO.T.t,FO.Ty.t) FO.Problem.t
* Conversion of problem from HO to FO
@raise NotInFO if some constructs are not translatable
... |
65e98b203672de9bb5291261df2aaeef49d08f96396145758224f7843a78fa0f | michalkonecny/aern2 | RootsInt.hs | module AERN2.Poly.Power.RootsInt
(
initialBernsteinCoefs
, bernsteinCoefs
, signVars
, reflect
, contract
, translate
, transform
, findRoots
--, reduce
, Terms
)
where
import AERN2.Poly.Power.RootsIntVector
| null | https://raw.githubusercontent.com/michalkonecny/aern2/1c8f12dfcb287bd8e3353802a94865d7c2c121ec/aern2-fun-univariate/src/AERN2/Poly/Power/RootsInt.hs | haskell | , reduce | module AERN2.Poly.Power.RootsInt
(
initialBernsteinCoefs
, bernsteinCoefs
, signVars
, reflect
, contract
, translate
, transform
, findRoots
, Terms
)
where
import AERN2.Poly.Power.RootsIntVector
|
c67c979ac571253bd2665f0f9b67638aebfe63526d6111641dd0c22dfc6a37bd | erlang/rebar3 | r3_hex_http.erl | %% Vendored from hex_core v0.7.1, do not edit manually
-module(r3_hex_http).
-export([request/5]).
-ifdef(TEST).
-export([user_agent/1]).
-endif.
-include_lib("r3_hex_core.hrl").
-type method() :: get | post | put | patch | delete.
-type status() :: non_neg_integer().
-export_type([status/0]).
-type headers() :: #{bi... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/src/vendored/r3_hex_http.erl | erlang | Vendored from hex_core v0.7.1, do not edit manually
TODO: remove in v0.9
====================================================================
==================================================================== |
-module(r3_hex_http).
-export([request/5]).
-ifdef(TEST).
-export([user_agent/1]).
-endif.
-include_lib("r3_hex_core.hrl").
-type method() :: get | post | put | patch | delete.
-type status() :: non_neg_integer().
-export_type([status/0]).
-type headers() :: #{binary() => binary()}.
-export_type([headers/0]).
-type b... |
ffecaca74543a4ad33c1c12e43aa2e1d3eb373ea7dfa4ac39edf9b023af6b869 | uswitch/big-replicate | project.clj | (defproject big-replicate "0.1.0"
:description "Copies data between BigQuery projects"
:url "-replicate"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:uberjar-name "big-replicate-standalone.jar"
:dependencies [[org.clojure/clojure "1.8.0"]
[gclouj/bigquery "0.2.5" :e... | null | https://raw.githubusercontent.com/uswitch/big-replicate/461085d4c9cdb6064cfdc64499f427f757bfcc8a/project.clj | clojure | (defproject big-replicate "0.1.0"
:description "Copies data between BigQuery projects"
:url "-replicate"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:uberjar-name "big-replicate-standalone.jar"
:dependencies [[org.clojure/clojure "1.8.0"]
[gclouj/bigquery "0.2.5" :e... | |
df861d1f59916c63cc5edbedc85f109f826835b9ce9437caa347e5b80163a359 | discus-lang/ddc | Store.hs |
module DDC.Core.Interface.Store
( -- * Types
Store (..)
, Meta (..)
, Interface (..)
, TyConThing (..)
, Error (..)
-- * Construction
, new, addInterface
-- * Fetching Data
, getMeta
, getModuleNames
, looku... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Core/Interface/Store.hs | haskell | * Types
* Construction
* Fetching Data
* Name Resolution |
module DDC.Core.Interface.Store
Store (..)
, Meta (..)
, Interface (..)
, TyConThing (..)
, Error (..)
, new, addInterface
, getMeta
, getModuleNames
, lookupInterface
, fetchInterface
, fetchModuleTransitiveDeps
... |
61782f66cab941b617b957441fdcf3f95a2b620761d25e11589bff77038e7553 | dwayne/eopl3 | ex2.22.rkt | #lang eopl
Exercise 2.22
;;
Using define - datatype , implement the stack data type of exercise 2.4 .
(provide
Construct
empty-stack
push
pop
;; Query
empty-stack?
top)
(define-datatype stack stack?
[empty]
[non-empty
(x any?)
(next stack?)])
(define (empty-stack)
(empty))
(define (push x... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/02-ch2/racket/ex2.22.rkt | racket |
Query
Helpers | #lang eopl
Exercise 2.22
Using define - datatype , implement the stack data type of exercise 2.4 .
(provide
Construct
empty-stack
push
pop
empty-stack?
top)
(define-datatype stack stack?
[empty]
[non-empty
(x any?)
(next stack?)])
(define (empty-stack)
(empty))
(define (push x s)
(non-em... |
abcab4fe198f3149810964965c550650e5333fca20940e82768af90fcb5dd5ea | penpot/penpot | text_test.cljc | 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 common-tests.text-test
(:require
[app.common.data :as d]
[app.common.text :as txt]
[clojure.tes... | null | https://raw.githubusercontent.com/penpot/penpot/f3472fcd790c2d1254b64a7d3e4510369914df9e/common/test/common_tests/text_test.cljc | clojure |
Copyright (c) KALEIDOS INC | 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 common-tests.text-test
(:require
[app.common.data :as d]
[app.common.text :as txt]
[clojure.test :as t :include-macros true]
... |
8297cc3030d69fcf825d3ef3d7984d41b2f7509c74a35edc65ed0af730335a4d | slyrus/mcclim-old | simple-spreadsheet.lisp | (eval-when (:compile-toplevel)
(asdf:oos 'asdf:load-op :clim)
(asdf:oos 'asdf:load-op :clim-clx))
(in-package :clim-user)
(defclass cell () ((content :accessor content :initarg :content)))
(defun make-cell (&rest args)
(apply #'make-instance 'cell args))
(define-presentation-type cell ())
(defvar loop-detect... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Doc/Guided-Tour/simple-spreadsheet.lisp | lisp | (eval-when (:compile-toplevel)
(asdf:oos 'asdf:load-op :clim)
(asdf:oos 'asdf:load-op :clim-clx))
(in-package :clim-user)
(defclass cell () ((content :accessor content :initarg :content)))
(defun make-cell (&rest args)
(apply #'make-instance 'cell args))
(define-presentation-type cell ())
(defvar loop-detect... | |
607a549bf5066918a37a50b9276eedd0774905f0c829f9bda183d0749a61dd35 | xtdb/xtdb | user.clj | (ns user
(:require [clojure.java.io :as io]
[clojure.tools.namespace.repl :as ctn])
(:import java.io.File))
(ctn/disable-reload!)
(apply ctn/set-refresh-dirs (for [^File dir (.listFiles (io/file "."))
:when (and (.isDirectory dir)
... | null | https://raw.githubusercontent.com/xtdb/xtdb/e2f51ed99fc2716faa8ad254c0b18166c937b134/dev/user.clj | clojure | (ns user
(:require [clojure.java.io :as io]
[clojure.tools.namespace.repl :as ctn])
(:import java.io.File))
(ctn/disable-reload!)
(apply ctn/set-refresh-dirs (for [^File dir (.listFiles (io/file "."))
:when (and (.isDirectory dir)
... | |
13ae6ae239fc724aca7b80709c42144f8d419c668e26f8179cbcaefad22cd981 | bozsahin/ccglab | g-dy.ccg.lisp | (defparameter *ccg-grammar*
'(((KEY 1) (PHON I) (MORPH N) (SYN ((BCAT NP) (FEATS ((AGR |1S|))))) (SEM "I")
(PARAM 1.0))
((KEY 2) (PHON THINK) (MORPH EN)
(SYN
((((BCAT S) (FEATS NIL)) (DIR BS) (MODAL ALL)
((BCAT NP) (FEATS ((AGR |1S|)))))
(DIR FS) (MODAL HARMONIC) ((BCAT S) (FEATS NIL))))
(SEM ... | null | https://raw.githubusercontent.com/bozsahin/ccglab/15def13c76e562a053ff92d61353549818d2a7e3/examples/type-raising-with-workflow/g-dy.ccg.lisp | lisp | (defparameter *ccg-grammar*
'(((KEY 1) (PHON I) (MORPH N) (SYN ((BCAT NP) (FEATS ((AGR |1S|))))) (SEM "I")
(PARAM 1.0))
((KEY 2) (PHON THINK) (MORPH EN)
(SYN
((((BCAT S) (FEATS NIL)) (DIR BS) (MODAL ALL)
((BCAT NP) (FEATS ((AGR |1S|)))))
(DIR FS) (MODAL HARMONIC) ((BCAT S) (FEATS NIL))))
(SEM ... | |
3c7a5d2f6e837f54169a164ec5ec8e1d987b5d9bf0b3e079b81cdc740fffa942 | haskell-servant/servant-quickcheck | Predicates.hs | module Servant.QuickCheck.Internal.Predicates where
import Control.Exception (catch, throw)
import Control.Monad (liftM2, unless, when)
import Data.Aeson (Object, decode)
import Data.Bifunctor (first)
import qualified Data.ByteString as SBS
im... | null | https://raw.githubusercontent.com/haskell-servant/servant-quickcheck/0535413b1a1e3f3e3f4dfdc3199761774513cce6/src/Servant/QuickCheck/Internal/Predicates.hs | haskell | | [__Best Practice__]
issue with the application code, and it moreover gives the client little
indication of how to proceed or what went wrong.
/Since 0.0.0.0/
| [__Optional__]
This function checks that the response from the server does not take longer
than the specified number of nanoseconds.
/Since 0.0.2... | module Servant.QuickCheck.Internal.Predicates where
import Control.Exception (catch, throw)
import Control.Monad (liftM2, unless, when)
import Data.Aeson (Object, decode)
import Data.Bifunctor (first)
import qualified Data.ByteString as SBS
im... |
513ff5cb690dbb1b89853ffcd05150505be8ed13f4d9428c6f625ffcaf46be32 | Kalimehtar/gtk-cffi | color-button.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; color-button.lisp --- Wrapper for GtkColorButton
;;;
Copyright ( C ) 2012 , < >
;;;
(in-package :gtk-cffi)
(defclass color-button (button color-chooser)
())
(defcfun gtk-color-button-new :pointer)
(defcfun gtk-color-button-new-with-color :pointer (color p... | null | https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/gtk/color-button.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
color-button.lisp --- Wrapper for GtkColorButton
| Copyright ( C ) 2012 , < >
(in-package :gtk-cffi)
(defclass color-button (button color-chooser)
())
(defcfun gtk-color-button-new :pointer)
(defcfun gtk-color-button-new-with-color :pointer (color pcolor))
(defcfun gtk-color-button-new-with-rgba :pointer (rgbd prgba))
(defmethod gconstructor ((color-button c... |
ff3203c8e5efb9305805d8970d47c3e145df9bc7c90f6334f9d8714d726ac6b6 | namin/biohacker | sudoku.lisp | (in-package :COMMON-LISP-USER)
;;; Statistics
(defvar *n-assumptions* 0)
(defvar *placements* nil)
(proclaim '(special *JTRE*))
(defvar *sudoku-rules-file*
(make-bps-source-file-name *jtre-path* "sudoku-rule"))
(defvar *puzzle*
'#(
#(4 0 0 0 0 0 8 0 5)
#(0 3 0 0 0 0 0 0 0)
#(0 0 0 7 0 0 0 0 0)
... | null | https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/BPS/jtms/sudoku.lisp | lisp | Statistics
(solve-sudoku *easy-puzzle* :debugging t)
(solve-sudoku *puzzle* :debugging t) | (in-package :COMMON-LISP-USER)
(defvar *n-assumptions* 0)
(defvar *placements* nil)
(proclaim '(special *JTRE*))
(defvar *sudoku-rules-file*
(make-bps-source-file-name *jtre-path* "sudoku-rule"))
(defvar *puzzle*
'#(
#(4 0 0 0 0 0 8 0 5)
#(0 3 0 0 0 0 0 0 0)
#(0 0 0 7 0 0 0 0 0)
#(0 2 0 0 0 ... |
2d8052bb51ff019cbf97d6362d83c86bcb63d03583d82e51fd7e249a4f4159f6 | jacquev6/General | Displayable.ml | #include "../Generated/Traits/Displayable.ml"
module Tests = struct
include Tests_
module MakeExamples(M: Testable.S0)(E: Examples.S0 with type t := M.t) = E
module MakeTests(M: Testable.S0)(E: Examples.S0 with type t := M.t) = struct
open Testing
open M
let tests = (
E.displays
|> Lis... | null | https://raw.githubusercontent.com/jacquev6/General/5237123668e939c0cb83aa3e1c4756473336bc7e/src/Traits/Displayable.ml | ocaml | #include "../Generated/Traits/Displayable.ml"
module Tests = struct
include Tests_
module MakeExamples(M: Testable.S0)(E: Examples.S0 with type t := M.t) = E
module MakeTests(M: Testable.S0)(E: Examples.S0 with type t := M.t) = struct
open Testing
open M
let tests = (
E.displays
|> Lis... | |
d22eb9695eed9c9c6129acf12b8664537cbf9215e176152919f32359cd6c6948 | froggey/Mezzano | support.lisp | ;;;; Support code with no specific home.
(in-package :mezzano.supervisor)
;; fixme: multiple-evaluation of PLACE.
(defmacro push-wired (item place)
"Like PUSH, but the CONS is allocated in the wired area."
`(setf ,place (sys.int::cons-in-area ,item ,place :wired)))
(defun string-length (string)
"Return the len... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/supervisor/support.lisp | lisp | Support code with no specific home.
fixme: multiple-evaluation of PLACE.
IMIN/IMAX are inclusive indicies.
List not empty
List empty
List not empty
List empty
head=tail, this is the last element.
Pop stuff.
head=tail, this is the last element.
Pop stuff.
Only element in the list
Somewhere in the middle of ... |
(in-package :mezzano.supervisor)
(defmacro push-wired (item place)
"Like PUSH, but the CONS is allocated in the wired area."
`(setf ,place (sys.int::cons-in-area ,item ,place :wired)))
(defun string-length (string)
"Return the length of STRING. For use when calling LENGTH is not safe."
(assert (sys.int::char... |
e15db067b59cce97f002cbc0679b1d1871e775624d8abdf113d1de358b5b062b | dakrone/itsy | textfiles.clj | (ns itsy.handlers.textfiles
"Handler to index web pages into a directory of text files"
(:require [clojure.java.io :refer [file]]
[clojure.tools.logging :refer [info debug trace warn]]
[clj-http.util :as util]
[itsy.extract :refer [html->str]]))
(defn make-textfile-handler
"Cr... | null | https://raw.githubusercontent.com/dakrone/itsy/4f591dec8b9152634499916245b77cb8f0b71eb4/src/itsy/handlers/textfiles.clj | clojure | (ns itsy.handlers.textfiles
"Handler to index web pages into a directory of text files"
(:require [clojure.java.io :refer [file]]
[clojure.tools.logging :refer [info debug trace warn]]
[clj-http.util :as util]
[itsy.extract :refer [html->str]]))
(defn make-textfile-handler
"Cr... | |
5f6a1be6771657d085e445e636fc8bc6f22025b73e96e5aaa07828ff7ddc96ca | rescript-lang/rescript-compiler | pervasives.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/5f3c033c054871372af853d850fe690c6d54d3c3/jscomp/stdlib-406/pervasives.ml | 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
Internal
external __unsafe_cast : 'a -> 'b = "%identity"
external raise : exn -> 'a = "%raise"
exter... |
475b9cff0195a079a0996c09c770d55f92231a301ab36b917a15a3cacb369eda | ocaml/odoc | tools.mli | (** Tools for manipulating the component data structures
This module contains tools for manipulating the {!module:Component}
data structures, for example, resolving paths and fragments, obtaining
signatures, handling fragment substitution and others.
*)
open Errors.Tools_error
type expansion =
| Signat... | null | https://raw.githubusercontent.com/ocaml/odoc/7acd9d9be85a299c1c3a532013199f1838eb194a/src/xref2/tools.mli | ocaml | * Tools for manipulating the component data structures
This module contains tools for manipulating the {!module:Component}
data structures, for example, resolving paths and fragments, obtaining
signatures, handling fragment substitution and others.
* [lookup_module ~mark_substituted env p] takes a resolve... |
open Errors.Tools_error
type expansion =
| Signature of Component.Signature.t
| Functor of Component.FunctorParameter.t * Component.ModuleType.expr
* { 2 Lookup and resolve functions }
* The following lookup and resolve functions take { { ! module : . paths }
( for lookup ) or { { ! module : . Cpath}un... |
5cd102b0565ff0658ea984fe19ae8d81ab33a3bbae9be8eca08f40c7fec05814 | expipiplus1/vulkan | XR_EXT_eye_gaze_interaction.hs | {-# language CPP #-}
-- | = Name
--
-- XR_EXT_eye_gaze_interaction - instance extension
--
-- = Specification
--
-- See
-- <#XR_EXT_eye_gaze_interaction XR_EXT_eye_gaze_interaction>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
31
--
-- = Revision
--
1
--
-- = Extens... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/openxr/src/OpenXR/Extensions/XR_EXT_eye_gaze_interaction.hs | haskell | # language CPP #
| = Name
XR_EXT_eye_gaze_interaction - instance extension
= Specification
See
<#XR_EXT_eye_gaze_interaction XR_EXT_eye_gaze_interaction>
in the main specification for complete information.
= Registered Extension Number
= Revision
= Extension and Version Dependencies
= See Also
'E... | 31
1
- Requires OpenXR 1.0
module OpenXR.Extensions.XR_EXT_eye_gaze_interaction ( SystemEyeGazeInteractionPropertiesEXT(..)
, EyeGazeSampleTimeEXT(..)
, EXT_eye_gaze_interaction_SPEC_VERSION
... |
a0572b31573ab90b73c9ae77b1a7acf2f3bd39a07dc95a69a92901b52da3673e | softwarelanguageslab/maf | R5RS_WeiChenRompf2019_the-little-schemer_ch1-4.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 2
; * negated predicates: 0
; * swapped branches: 0
* calls to i d fun : 1
(letrec ((atom? (lambda (x)
(if (not (pair? x)) (not (null? x)) #f))))
(atom? 'atom)
(<change>
(atom? 'turkey)
(atom? 1942))
(<change>
(atom? 194... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_WeiChenRompf2019_the-little-schemer_ch1-4.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0 | * removed : 0
* added : 1
* swaps : 2
* calls to i d fun : 1
(letrec ((atom? (lambda (x)
(if (not (pair? x)) (not (null? x)) #f))))
(atom? 'atom)
(<change>
(atom? 'turkey)
(atom? 1942))
(<change>
(atom? 1942)
(atom? 'turkey))
(atom? 'u)
(atom? '*abc$)
... |
ec69171cc1b9acee3c45007b4484668d90c44a79b3a50a8ffcf5705886f6ab90 | dbuenzli/topkg | topkg_care_ipc.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/topkg/ea1e0981a18ce4160ec21e8a73f67cb748059671/src-care/topkg_care_ipc.ml | ocaml | ignore | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
28e07106fde50c230aca144cbfcc8230e205ac5739328fb2425a0588f1fc3c15 | hypernumbers/hypernumbers | upgrade_to_2884.erl | %%%-------------------------------------------------------------------
@author
( C ) 2009 , Hypernumbers Ltd
%%% @doc code to manage backup and restore etc as well
%%% as 'grabbing' sites and applications
%%%
%%% @end
Created : 18 Dec 2009 by
%%%----------------------------------------... | null | https://raw.githubusercontent.com/hypernumbers/hypernumbers/281319f60c0ac60fb009ee6d1e4826f4f2d51c4e/src/upgrade_to_2884.erl | erlang | -------------------------------------------------------------------
@doc code to manage backup and restore etc as well
as 'grabbing' sites and applications
@end
-------------------------------------------------------------------
Internal Functions
io:format("Page is ~p~n", [hn_db_api:read_whole... | @author
( C ) 2009 , Hypernumbers Ltd
Created : 18 Dec 2009 by
-module(upgrade_to_2884).
-include("../lib/hypernumbers-1.0/include/spriki.hrl").
-export([
grab_site/1,
import_site/1
]).
import_site(URL) ->
"http://" ++ SiteAndPort = URL,
[Site, Port] = string:tokens... |
bfa1b0da0d33cad59ef905f62f60ae32cbb5a212713225558a278d2b9f15f158 | audreyt/openafp | MBC.hs |
module OpenAFP.Records.AFP.MBC where
import OpenAFP.Types
import OpenAFP.Internals
data MBC = MBC {
mbc_Type :: !N3
,mbc_ :: !N3
,mbc :: !NStr
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/AFP/MBC.hs | haskell |
module OpenAFP.Records.AFP.MBC where
import OpenAFP.Types
import OpenAFP.Internals
data MBC = MBC {
mbc_Type :: !N3
,mbc_ :: !N3
,mbc :: !NStr
} deriving (Show, Typeable)
| |
73f17ae50e18f58415564069709d99277c07a5cffc28e623bfe2f4deecdadc00 | juanmirocks/CL-HMM | cl-hmm.lisp | Author :
Created : We d Jul 9 18:09:49 2008 ( CEST )
Last - Updated : 2011 - 08 - 11
By :
Update # : 39
(in-package :cl-hmm)
(declaim (optimize (speed 0) (safety 3) (compilation-speed 0) (debug 3)))
#+sbcl (declaim (sb-ext:muffle-conditions sb-ext:compiler-note))
;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/juanmirocks/CL-HMM/9e3863e41dec811032927ec29319128ae34d1984/src/cl-hmm.lisp | lisp |
to avoid underflows
Empty emission epsilon symbol, ε
other
see hmm-correctp
list of specialized hmm's classes.
metaclass HMMs to cover all hmm methods
Define all sub HMMs through this macro: defines its multiple slot accessor, and add the name type to the global list
multiple-accessor explanation: see with-typed... | Author :
Created : We d Jul 9 18:09:49 2008 ( CEST )
Last - Updated : 2011 - 08 - 11
By :
Update # : 39
(in-package :cl-hmm)
(declaim (optimize (speed 0) (safety 3) (compilation-speed 0) (debug 3)))
#+sbcl (declaim (sb-ext:muffle-conditions sb-ext:compiler-note))
(eval-when (:compile... |
84e7e560099756e7a14e27da97339eb29b41ff17e4160a8dd02aee96c1df9acb | baffalop/aoc22-haskell | Day04.hs | module Day04 (parse, solve1, solve2) where
import Data.Text (Text)
import qualified Data.Attoparsec.Text as P
import Parsing (linesOf, pairBy)
import Utils (within)
type Area = (Int, Int)
type Input = [(Area, Area)]
parse :: Text -> Either String Input
parse = P.parseOnly $ linesOf $ pairBy ',' (pairBy '-' P.decimal... | null | https://raw.githubusercontent.com/baffalop/aoc22-haskell/45360a2109b91a63f70d00b51aebc911360be7e1/src/Day04.hs | haskell | module Day04 (parse, solve1, solve2) where
import Data.Text (Text)
import qualified Data.Attoparsec.Text as P
import Parsing (linesOf, pairBy)
import Utils (within)
type Area = (Int, Int)
type Input = [(Area, Area)]
parse :: Text -> Either String Input
parse = P.parseOnly $ linesOf $ pairBy ',' (pairBy '-' P.decimal... | |
4085765d59a451167c432c562a8ef262d8de01a07ca030bd4a303706f39fcddf | WorksHub/client | candidates.cljc | (ns wh.components.pods.candidates
(:require
[wh.components.button-auth :as button-auth]
[wh.components.common :refer [link]]
[wh.components.icons :refer [icon]]
[wh.re-frame.subs :refer [<sub]]
[wh.util :as util]))
(defn candidate-cta
[& [cls]]
(when-not (<sub [:user/logged-in?])
[:sectio... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/common/src/wh/components/pods/candidates.cljc | clojure | (ns wh.components.pods.candidates
(:require
[wh.components.button-auth :as button-auth]
[wh.components.common :refer [link]]
[wh.components.icons :refer [icon]]
[wh.re-frame.subs :refer [<sub]]
[wh.util :as util]))
(defn candidate-cta
[& [cls]]
(when-not (<sub [:user/logged-in?])
[:sectio... | |
42d9d9ac1a49c57bab3907cd75957432bcf8d49e933f3660c60b8a7513373065 | hadolint/hadolint | DL3006Spec.hs | module Hadolint.Rule.DL3006Spec (spec) where
import Data.Default
import Data.Text as Text
import Helpers
import Test.Hspec
spec :: SpecWith ()
spec = do
let ?config = def
describe "DL3006 - Always tag the version of an image explicitly." $ do
it "no untagged" $ ruleCatches "DL3006" "FROM debian"
it "no ... | null | https://raw.githubusercontent.com/hadolint/hadolint/bf7e48ea735db423a349fb2d7a83fe7a77091cc2/test/Hadolint/Rule/DL3006Spec.hs | haskell | module Hadolint.Rule.DL3006Spec (spec) where
import Data.Default
import Data.Text as Text
import Helpers
import Test.Hspec
spec :: SpecWith ()
spec = do
let ?config = def
describe "DL3006 - Always tag the version of an image explicitly." $ do
it "no untagged" $ ruleCatches "DL3006" "FROM debian"
it "no ... | |
e38cc056359d01674345fda6c638977a85fceed7b2b2ce7722df090be4489a07 | uhc/uhc | Pool.hs | # LANGUAGE NoImplicitPrelude , CPP #
# OPTIONS_GHC -XNoImplicitPrelude #
# EXCLUDE_IF_TARGET js #
--------------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Pool
Copyright : ( c ) 2002 - 2004
-- License : BSD-style (see the file libraries/base/L... | null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/ehclib/uhcbase/Foreign/Marshal/Pool.hs | haskell | ------------------------------------------------------------------------------
|
Module : Foreign.Marshal.Pool
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
This module contains support for pooled memory management. Unde... | # LANGUAGE NoImplicitPrelude , CPP #
# OPTIONS_GHC -XNoImplicitPrelude #
# EXCLUDE_IF_TARGET js #
Copyright : ( c ) 2002 - 2004
' Foreign.Marshal.Alloc.alloca ' with its implicit allocation and deallocation
module Foreign.Marshal.Pool (
Pool,
: : IO Pool
* ( Re-)Allocation within a pool
) where
... |
68ef6c239841f968c65bb33dd208c9d2e447ca53de6d13bd0c923e5a9511d430 | LambdaHack/LambdaHack | Item.hs | # LANGUAGE DeriveGeneric , GeneralizedNewtypeDeriving , TupleSections #
-- | Weapons, treasure and all the other items in the game.
module Game.LambdaHack.Common.Item
( Item(..), ItemIdentity(..)
, ItemKindIx, ItemDisco(..), ItemFull(..), ItemFullKit
, DiscoveryKind, DiscoveryAspect, ItemIxMap, Benefit(..), Disco... | null | https://raw.githubusercontent.com/LambdaHack/LambdaHack/04c78e37c66c978c9be3e6a4121a9590031cdc49/engine-src/Game/LambdaHack/Common/Item.hs | haskell | | Weapons, treasure and all the other items in the game.
* Internal operations
| Game items in actor possesion or strewn around the dungeon.
The information contained in this time is available to the player
Some items are not created identified (@IdentityCovered@).
Then they are presented as having a template ki... | # LANGUAGE DeriveGeneric , GeneralizedNewtypeDeriving , TupleSections #
module Game.LambdaHack.Common.Item
( Item(..), ItemIdentity(..)
, ItemKindIx, ItemDisco(..), ItemFull(..), ItemFullKit
, DiscoveryKind, DiscoveryAspect, ItemIxMap, Benefit(..), DiscoveryBenefit
, ItemTimer, ItemTimers, ItemQuant, ItemBag, I... |
a9af8d8f9f61e589aa2dfdb77820008701e0f3c80291177edff76796a2983f15 | ekmett/ekmett.github.com | Ideal.hs | {-# OPTIONS_GHC -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
Module : Control . Monad . Ideal
Copyright : ( C ) 2008
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : experimental
-- Portability :... | null | https://raw.githubusercontent.com/ekmett/ekmett.github.com/8d3abab5b66db631e148e1d046d18909bece5893/haskell/category-extras-backup/_darcs/pristine/src/Control/Monad/Ideal.hs | haskell | # OPTIONS_GHC -fglasgow-exts #
---------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : portable
--------------------------------------------------------------------------
* Ideal Monads
* Coideal Com... | Module : Control . Monad . Ideal
Copyright : ( C ) 2008
Maintainer : < >
module Control.Monad.Ideal
(
MonadIdeal(..)
, Ideal
, ideal
, ComonadCoideal(..)
, Coideal
, coideal
, Mutual(..)
, (:*)
* Ideal
, (:+)
) where
import Prelude hiding (fst, snd)
import Control.Category... |
73fe7dd8ee96293c21329ad213a48a7cc2448bf93e0b71b3f8574d6fc7701084 | filipesilva/datafire | test_helpers.cljs | (ns datafire.test-helpers
(:require [cljs.core.async :refer [go]]
[datascript.core :as d]
[datafire.core :as df]
["firebase/app" :as firebase]
["firebase/firestore"]))
(def firebase-config #js {:apiKey "AIzaSyAYJX2_LdpTbdgcaGYvSbfz9hJplqTPi7Y"
... | null | https://raw.githubusercontent.com/filipesilva/datafire/84bc3fd0fca563ff0aeaba6cfcdd95dc314ebc75/src/test/datafire/test_helpers.cljs | clojure | (ns datafire.test-helpers
(:require [cljs.core.async :refer [go]]
[datascript.core :as d]
[datafire.core :as df]
["firebase/app" :as firebase]
["firebase/firestore"]))
(def firebase-config #js {:apiKey "AIzaSyAYJX2_LdpTbdgcaGYvSbfz9hJplqTPi7Y"
... | |
231f5ad631207df673c6f3e6173e939eb81e5bb6a3a2e13a3ba73692a1523b75 | mmottl/lacaml | impl_SD.mli | File : impl_SD.mli
Copyright ( C ) 2001-
email :
WWW :
email :
WWW : /~liam
email :
WWW : /
email :
WWW : /~ot14
email :
WWW : none
This library is free software ; you can redistri... | null | https://raw.githubusercontent.com/mmottl/lacaml/2e01c0747e740e54ab9a23ea59b29ea0d929b50f/src/impl_SD.mli | ocaml | * [lansy_min_lwork m norm]
@return the minimum length of the work array used by the [lansy]-function.
@param norm type of norm that will be computed by [lansy]
@param n the number of columns (and rows) in the matrix
ORGQR
* [orgqr_min_lwork ~n] @return the minimum length of the
work-array used by the... | File : impl_SD.mli
Copyright ( C ) 2001-
email :
WWW :
email :
WWW : /~liam
email :
WWW : /
email :
WWW : /~ot14
email :
WWW : none
This library is free software ; you can redistri... |
3c5cf4c302d1eed382490b684a92cc25690b6eb7db582ff5da04549743b4e997 | cbaggers/skitter | mouse-buttons.lisp | (in-package skitter.sdl2.mouse-buttons)
(defun mouse.button-id (name/event)
(etypecase name/event
(keyword
(or (position name/event skitter.sdl2::*mouse-button-names*)
(error "mouse.button-id: invalid name ~s" name/event)))
(t (error "mouse.button-id: Must be given a keyword name or an instanc... | null | https://raw.githubusercontent.com/cbaggers/skitter/620772ae6146d510a8d58d07cae055c06e5c8620/sdl2/mouse-buttons.lisp | lisp | (in-package skitter.sdl2.mouse-buttons)
(defun mouse.button-id (name/event)
(etypecase name/event
(keyword
(or (position name/event skitter.sdl2::*mouse-button-names*)
(error "mouse.button-id: invalid name ~s" name/event)))
(t (error "mouse.button-id: Must be given a keyword name or an instanc... | |
cf287745469a59b14c7b266ebeb86bffe999c238252f3e9052af2727deb7c8c0 | PrecursorApp/precursor | errors.cljs | (ns frontend.controllers.errors
(:require [cljs.core.async :as async :refer [>! <! alts! put! chan sliding-buffer close!]]
[clojure.string :as str]
[datascript.core :as d]
[frontend.overlay :as overlay]
[frontend.camera :as cameras]
[frontend.models.chat :as... | null | https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src-cljs/frontend/controllers/errors.cljs | clojure | --- Errors Multimethod Declarations ---
--- Errors Multimethod Implementations ---
When we have more fine-grained permissions, we'll put more info
into the state
When we have more fine-grained permissions, we'll put more info
into the state | (ns frontend.controllers.errors
(:require [cljs.core.async :as async :refer [>! <! alts! put! chan sliding-buffer close!]]
[clojure.string :as str]
[datascript.core :as d]
[frontend.overlay :as overlay]
[frontend.camera :as cameras]
[frontend.models.chat :as... |
f2e394b1dcf951a0a8319f862d3861d6f4bed31b6d6d210f9c7e67bc858d68c3 | ghc/ghc | T22151.hs | # LANGUAGE UndecidableInstances #
module T22151 where
import Control.Monad.IO.Class (MonadIO(liftIO))
class (Applicative m, Monad m) => C m where
m :: m ()
-- This should not emit a -Wredundant-constraints warning. This is because
GHC should not expand the superclasses of the Given constraint ` MonadIO m `
giv... | null | https://raw.githubusercontent.com/ghc/ghc/14b5982a3aea351e4b01c5804ebd4d4629ba6bab/testsuite/tests/warnings/should_compile/T22151.hs | haskell | This should not emit a -Wredundant-constraints warning. This is because
and `Monad m` constraints explicitly. | # LANGUAGE UndecidableInstances #
module T22151 where
import Control.Monad.IO.Class (MonadIO(liftIO))
class (Applicative m, Monad m) => C m where
m :: m ()
GHC should not expand the superclasses of the Given constraint ` MonadIO m `
given that it is not - smaller than the instance head ` C m ` . ( See
Note ... |
efddf812129fcc5a3c3eea604799b4eb1c5d39f8a37e64f031e38a7753a706f3 | anoma/juvix-circuits | ref.lisp | (in-package :alu.reference)
(defstruct ref contents)
(defun ref (x)
"Creates a reference out of x"
(make-ref :contents x))
(defun ! (ref)
"Grabs the contents of a reference"
(ref-contents ref))
(defun (setf !) (x ref)
"sets the reference value to x"
(setf (ref-contents ref) x))
| null | https://raw.githubusercontent.com/anoma/juvix-circuits/51f8ea2db5b1200c400ff1bc6d5f51249afc0073/src/reference/ref.lisp | lisp | (in-package :alu.reference)
(defstruct ref contents)
(defun ref (x)
"Creates a reference out of x"
(make-ref :contents x))
(defun ! (ref)
"Grabs the contents of a reference"
(ref-contents ref))
(defun (setf !) (x ref)
"sets the reference value to x"
(setf (ref-contents ref) x))
| |
966017c63558cf2e7b9b0545f40076af81cbde1303907fac67bc27393d5ec5e5 | jarohen/advent-of-code | day14.clj | (ns aoc2021.day14
(:require [clojure.string :as str]
[clojure.test :as t]
[aoc2021.util :as util])
(:import clojure.lang.MapEntry))
(defn parse-input [input-lines]
(let [[start _ & rules] input-lines]
{:start (vec start)
:rules (->> rules
(into {} (map (fn [rule]... | null | https://raw.githubusercontent.com/jarohen/advent-of-code/95993d2a852e757c023b32fb1fefd2763ddd0815/2021/src/aoc2021/day14.clj | clojure | heads | (ns aoc2021.day14
(:require [clojure.string :as str]
[clojure.test :as t]
[aoc2021.util :as util])
(:import clojure.lang.MapEntry))
(defn parse-input [input-lines]
(let [[start _ & rules] input-lines]
{:start (vec start)
:rules (->> rules
(into {} (map (fn [rule]... |
23a290f1d2b638a660857ed5011ca8814ef514d212de0fd3349a891659fa53ad | returntocorp/ocaml-tree-sitter-core | Tree_sitter_output.mli | (*
OCaml-friendly representation of parse trees produced by tree-sitter.
*)
(* Convert the C API tree to a convenient OCaml tree. *)
val of_ts_tree : Tree_sitter_API.ts_tree -> Tree_sitter_output_t.node
(*
Convert the C API tree to json. This contains at least all the original
data.
The output is nicely ... | null | https://raw.githubusercontent.com/returntocorp/ocaml-tree-sitter-core/28f750bb894ea4c0a7f6b911e568ab9d731cc0b5/src/bindings/lib/Tree_sitter_output.mli | ocaml |
OCaml-friendly representation of parse trees produced by tree-sitter.
Convert the C API tree to a convenient OCaml tree.
Convert the C API tree to json. This contains at least all the original
data.
The output is nicely indented by default, which can be very slow on
large input. Use '~pretty:false'... |
val of_ts_tree : Tree_sitter_API.ts_tree -> Tree_sitter_output_t.node
val to_json : ?pretty:bool -> Tree_sitter_output_t.node -> string
|
9179ddedf8c6bbdd073aa07c240b3f9d630ee006acf78710cfe19008c825f704 | takikawa/racket-ppa | case-arrow.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/name)
(only-in racket/list last)
racket/stxparam
"guts.rkt"
"blame.rkt"
"prop.rkt"
"misc.rkt"
"arrow-common.rkt"
"arrow-val-first.rkt")
(provide case->
(for-s... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/collects/racket/contract/private/case-arrow.rkt | racket | for case->m
for object-contract
;
;;;;; ;;;;;;; ;;;;; ;;; ;;; ... | #lang racket/base
(require (for-syntax racket/base
syntax/name)
(only-in racket/list last)
racket/stxparam
"guts.rkt"
"blame.rkt"
"prop.rkt"
"misc.rkt"
"arrow-common.rkt"
"arrow-val-first.rkt")
(provide case->
(define-for... |
94bccde293817dbf7924f5be2fa361c66340cae6d2198d6626983d816d01f159 | MaskRay/CamlFeatherweight | config.ml | let word_size = 64
let sizeof_word = word_size / 8
let obj_magic32 = "zo32"
let obj_magic64 = "zo64"
let exe_magic32 = "ml32"
let exe_magic64 = "ml64"
let obj_magic = if word_size = 32 then obj_magic32 else obj_magic64
let exe_magic = if word_size = 32 then exe_magic32 else exe_magic64
| null | https://raw.githubusercontent.com/MaskRay/CamlFeatherweight/989319a830dcf1ae30a4b4ccefb59f73bf966363/config.ml | ocaml | let word_size = 64
let sizeof_word = word_size / 8
let obj_magic32 = "zo32"
let obj_magic64 = "zo64"
let exe_magic32 = "ml32"
let exe_magic64 = "ml64"
let obj_magic = if word_size = 32 then obj_magic32 else obj_magic64
let exe_magic = if word_size = 32 then exe_magic32 else exe_magic64
| |
203febfdcf484dbd613251e2e981f027b5b65f075269bf2327148ef445bab63b | huangz1990/SICP-answers | 36-car-n.scm | 36-car-n.scm
(define (car-n seqs)
(map car seqs))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/36-car-n.scm | scheme | 36-car-n.scm
(define (car-n seqs)
(map car seqs))
| |
5e9f13b568c6b2ea8ceeb6acab2515f4a1cb9fbd9435a083919c50944bd28fd4 | ocaml-flambda/ocaml-jst | out_channel.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/5bf2820278c58f6715dcfaf6fa61e09a9b0d8db3/stdlib/out_channel.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2021 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* Output channels .
@since 4.14.0
@since 4.14.0 *)
open! Stdlib
type t = out_channel
type op... |
0b3016700f8ea82af58ab22a9697a89eead21532f38329a84bd46813fd6a5ad6 | pedestal/pedestal-app | automatic.cljs | Copyright 2013 Relevance , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; which can be found in the file epl-v10.html at the root of this distribution.
;
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this licens... | null | https://raw.githubusercontent.com/pedestal/pedestal-app/509ab766a54921c0fbb2dd7c6a3cb20223b8e1a1/app/src/io/pedestal/app/render/push/handlers/automatic.cljs | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
O... | Copyright 2013 Relevance , Inc.
Eclipse Public License 1.0 ( )
(ns io.pedestal.app.render.push.handlers.automatic
(:require [cljs.reader :as reader]
[io.pedestal.app.util.log :as log]
[io.pedestal.app.render.push :as render]
[io.pedestal.app.messages :as msg]
[io... |
588553286d30a3308a80e3a1f686c2e1991d51dbce498b7f1e1fdd5668cf7a0d | stephenpascoe/hs-arrow | PoolBuffer.hs |
|
Copyright : , and
License : LGPL-2.1
Maintainer : ( )
It wraps @arrow::PoolBuffer@.
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria ()
It wraps @arrow::PoolBuffer@.
-}
#define ENABLE_OVERLOADING (MIN_VERS... | null | https://raw.githubusercontent.com/stephenpascoe/hs-arrow/86c7c452a8626b1d69a3cffd277078d455823271/gi-arrow/GI/Arrow/Objects/PoolBuffer.hs | haskell | * Exported types
* Methods
# SOURCE #
# SOURCE #
# SOURCE #
| Memory-managed wrapper type.
# OVERLAPPABLE #
method type : Constructor
Lengths : []
throws : False
Skip return : False |
|
Copyright : , and
License : LGPL-2.1
Maintainer : ( )
It wraps @arrow::PoolBuffer@.
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria ()
It wraps @arrow::PoolBuffer@.
-}
#define ENABLE_OVERLOADING (MIN_VERS... |
9727d5ab5aa93781c83d009212def5f8538fb68379af493d323225d2404cff67 | ggreif/omega | TokenDef.hs | # LANGUAGE FlexibleContexts #
module TokenDef ( tokenDef, unitState ) where
import Text.Parsec.Token
import Text.Parsec.Language
import Text.Parsec.Prim
import Text.Parsec.Char
import CommentDef
import Data.Functor.Identity
import Unsafe.Coerce (unsafeCoerce)
omegaStyle = haskellStyle
{ commentEnd = cEnd
, com... | null | https://raw.githubusercontent.com/ggreif/omega/016a3b48313ec2c68e8d8ad60147015bc38f2767/src/TokenDef.hs | haskell | these do not cast benignly :-( | # LANGUAGE FlexibleContexts #
module TokenDef ( tokenDef, unitState ) where
import Text.Parsec.Token
import Text.Parsec.Language
import Text.Parsec.Prim
import Text.Parsec.Char
import CommentDef
import Data.Functor.Identity
import Unsafe.Coerce (unsafeCoerce)
omegaStyle = haskellStyle
{ commentEnd = cEnd
, com... |
74627d3a3e30cc18851cc8419f9915b6dae8bafc50cb7c17edde8f2f8bf22e5e | donaldsonjw/bigloo | bexit.scm | ;*---------------------------------------------------------------------*/
* serrano / prgm / project / bigloo / recette / bexit.scm * /
;* */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/recette/bexit.scm | scheme | *---------------------------------------------------------------------*/
* */
* */
* On test les trois sortes de `bind-exit' */
*---------------------------... | * serrano / prgm / project / bigloo / recette / bexit.scm * /
* Author : * /
* Creation : Fri Jun 12 10:06:03 1992 * /
* Last change : Fri Jan 17 08:00:29 2014 ( serrano ) * /
(module bin... |
c73d9fd25558497f7f02234de62cd2cafe49e79b2276d3eb4ca5cff6affdeeb2 | haskell/cabal | SrcDist.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Utilities to implement cabal @v2-sdist@.
module Distribution.Client.SrcDist (
allPackageSourceFiles,
packageDirToSdist,
) where
import Distribution.Client.Compat.Prelude
import Prelude ()
import Control.Monad.State.Lazy (StateT, evalStateT, gets, modify)
import Contro... | null | https://raw.githubusercontent.com/haskell/cabal/63841fb3380b902d12118fc272b5421a923cd647/cabal-install/src/Distribution/Client/SrcDist.hs | haskell | # LANGUAGE OverloadedStrings #
| Utilities to implement cabal @v2-sdist@.
| List all source files of a given add-source dependency. Exits with error if
something is wrong (e.g. there is no .cabal file in the given directory).
Used in sandbox and projectbuilding.
TODO: when sandboxes are removed, move to ProjectBu... | module Distribution.Client.SrcDist (
allPackageSourceFiles,
packageDirToSdist,
) where
import Distribution.Client.Compat.Prelude
import Prelude ()
import Control.Monad.State.Lazy (StateT, evalStateT, gets, modify)
import Control.Monad.Trans (liftIO)
import Control.Monad.Writer.Lazy (WriterT, execWrite... |
92e073bdfdaeaceaafb5d1d0c5a0974e01a03765aaca6914d0b354c50a7b7ad2 | tidalcycles/tidal-midi | MiniAtmegatron.hs | |
miniAtmegatron - Soulsby Synthesizers
-content/uploads/2016/08/Mini-Manual.pdf , page 15
miniAtmegatron - Soulsby Synthesizers
-content/uploads/2016/08/Mini-Manual.pdf, page 15
-}
module Sound.Tidal.MIDI.MiniAtmegatron where
import Sound.Tidal.MIDI.Control
import Sound.Tidal.Params
matmController :: Contr... | null | https://raw.githubusercontent.com/tidalcycles/tidal-midi/0f806c31daee46bb54053dc3407349001a0e00b8/Sound/Tidal/MIDI/MiniAtmegatron.hs | haskell | |
miniAtmegatron - Soulsby Synthesizers
-content/uploads/2016/08/Mini-Manual.pdf , page 15
miniAtmegatron - Soulsby Synthesizers
-content/uploads/2016/08/Mini-Manual.pdf, page 15
-}
module Sound.Tidal.MIDI.MiniAtmegatron where
import Sound.Tidal.MIDI.Control
import Sound.Tidal.Params
matmController :: Contr... | |
7ead97c33148170c44dd8cf2831c9c56d33c6fd11c389682d3a3c4c7485ef9ca | francescoc/erlangprogramming | log_handler.erl | %% Code from
%% Erlang Programming
and
O'Reilly , 2008
%% /
%% http:-module(log_handler).
-module(log_handler).
-export([init/1, terminate/1, handle_event/2]).
init(File) ->
{ok, Fd} = file:open(File, write),
Fd.
terminate(Fd) -> file:close(Fd).
handle_event({Action, Id, Event}, Fd) ->
{Me... | null | https://raw.githubusercontent.com/francescoc/erlangprogramming/b4c39cbebe6599f23eb9d1a052316baf75e40a47/chapter5/log_handler.erl | erlang | Code from
Erlang Programming
/
http:-module(log_handler). | and
O'Reilly , 2008
-module(log_handler).
-export([init/1, terminate/1, handle_event/2]).
init(File) ->
{ok, Fd} = file:open(File, write),
Fd.
terminate(Fd) -> file:close(Fd).
handle_event({Action, Id, Event}, Fd) ->
{MegaSec, Sec, MicroSec} = now(),
Args = io:format(Fd, "~w,~w,~w,~w,~w,~p~n",
... |
0f2f9a3e232d8b30fda4550dbc9b133a392b5d41198a1c67e43273158c567297 | EveryTian/Haskell-Codewars | permutations.hs | --
module Codewars.Kata.Permutations (permutations) where
import Data.List hiding (permutations)
permutations :: String -> [String]
permutations = delSame . allOrder
where allOrder "" = [""]
allOrder (c:"") = [[c]]
allOrder str = concat [[(str !! j) : i | i <- allOrder $ removeAt j str] | j ... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/4kyu/permutations.hs | haskell |
module Codewars.Kata.Permutations (permutations) where
import Data.List hiding (permutations)
permutations :: String -> [String]
permutations = delSame . allOrder
where allOrder "" = [""]
allOrder (c:"") = [[c]]
allOrder str = concat [[(str !! j) : i | i <- allOrder $ removeAt j str] | j <- [... | |
5bea28b8f0c526dbc92968123c88e8857fbdf4a5e0fdbc41ca0602800396989c | returntocorp/semgrep | Skip_target.mli | This is using the skip_list.txt of pfff Skip_code.ml
val exclude_files_in_skip_lists :
Common.filename list ->
Common.filename list * Output_from_core_t.skipped_target list
(* This is using Flag_semgrep.max_target_bytes *)
val exclude_big_files :
Common.filename list ->
Common.filename list * Output_from_cor... | null | https://raw.githubusercontent.com/returntocorp/semgrep/70af5900482dd15fcce9b8508bd387f7355a531d/src/targeting/Skip_target.mli | ocaml | This is using Flag_semgrep.max_target_bytes
Detecting and filtering minified files (for Javascript) | This is using the skip_list.txt of pfff Skip_code.ml
val exclude_files_in_skip_lists :
Common.filename list ->
Common.filename list * Output_from_core_t.skipped_target list
val exclude_big_files :
Common.filename list ->
Common.filename list * Output_from_core_t.skipped_target list
val exclude_minified_file... |
34096c0e3bea2d01c84f3eef2b5e6da30222666f7beddea820ee8cb09419e2f9 | deepfire/holotype | Holotype.hs | # OPTIONS_GHC -Wall -Wno - unticked - promoted - constructors -Wno - unused - imports -Wno - type - defaults -Wno - orphans -fconstraint - solver - iterations=0 #
{ - # OPTIONS_GHC -ddump - deriv # - } -- +
--{-# OPTIONS_GHC -ddump-rn #-} -- +
--{-# OPTIONS_GHC -ddump-tc-trace #-} -- +
--{-#... | null | https://raw.githubusercontent.com/deepfire/holotype/d33052f588b74616560b81616ffc4a0142f8a617/src/Holotype.hs | haskell | +
{-# OPTIONS_GHC -ddump-rn #-} -- +
{-# OPTIONS_GHC -ddump-tc-trace #-} -- +
{-# OPTIONS_GHC -ddump-tc #-} -- -
-
{-# OPTIONS_GHC -ddump-ds #-} -- -
Local imports
TEMPORARY
XXX: this is atrocious, but the suspicion is we have a generic solution : -
The loop demo (curren... | # OPTIONS_GHC -Wall -Wno - unticked - promoted - constructors -Wno - unused - imports -Wno - type - defaults -Wno - orphans -fconstraint - solver - iterations=0 #
module Holotype
where
import qualified Codec.Picture as Juicy
import qualified Codec.Picture.Saving as Juicy
import qualifie... |
5ad5e0dfe0c2b2d86990b9f93fc0bff731cf7f1066af4f6d7d2dca4b6a3b6e90 | pyr/warp | ssl.clj | (ns warp.ssl
"Clojure glue code to interact with the horrible JVM SSL code"
(:require [clojure.java.io :as io])
(:import io.netty.handler.ssl.ClientAuth
io.netty.handler.ssl.SslContextBuilder))
(defn server-context
"Build an SSL client context for netty"
[{:keys [pkey cert ca-cert]}]
(-> (SslCon... | null | https://raw.githubusercontent.com/pyr/warp/c3ee96d90b233a47c1104b4339fed071ec8afe68/src/warp/ssl.clj | clojure | (ns warp.ssl
"Clojure glue code to interact with the horrible JVM SSL code"
(:require [clojure.java.io :as io])
(:import io.netty.handler.ssl.ClientAuth
io.netty.handler.ssl.SslContextBuilder))
(defn server-context
"Build an SSL client context for netty"
[{:keys [pkey cert ca-cert]}]
(-> (SslCon... | |
0270295fb34a0b55a1f5c07fad773967af7ff571d31009381a7e3cedc18281b0 | AccelerateHS/accelerate-examples | Naive2.hs |
module Solver.Naive2
where
import Common.Type
import Common.Body
import Data.Array.Accelerate as A
-- | Calculate accelerations on these particles in a naïve O(n^2) way.
--
-- This maps a _sequential_ reduction to get the total contribution for this
-- body from all other bodies in the sys... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/n-body/Solver/Naive2.hs | haskell | | Calculate accelerations on these particles in a naïve O(n^2) way.
This maps a _sequential_ reduction to get the total contribution for this
body from all other bodies in the system.
|
module Solver.Naive2
where
import Common.Type
import Common.Body
import Data.Array.Accelerate as A
calcAccels :: Exp R -> Acc (Vector PointMass) -> Acc (Vector Accel)
calcAccels epsilon bodies
= let move body = A.sfoldl (\acc next -> acc + accel epsilon body next)
... |
c26dfc4de78b381667d3b44136b30f1e7bede1387eb8a3109c9247578d09d1be | deadtrickster/cl-statsd | dummy.lisp | (in-package :cl-statsd.test)
(plan 1)
(subtest "Dummy, sanity check"
(ok :t "T is T"))
(finalize)
| null | https://raw.githubusercontent.com/deadtrickster/cl-statsd/7790c95c097f690994256519d24106b53c3e5e37/t/dummy.lisp | lisp | (in-package :cl-statsd.test)
(plan 1)
(subtest "Dummy, sanity check"
(ok :t "T is T"))
(finalize)
| |
958d6b212f6b53e857bf67979129a8acba65c51ebb5f172dfb87c292a87776e8 | mooreryan/ocaml_python_bindgen | run.ml | open! Base
open Lib
open Stdio
let () = Py.initialize ()
let cat = Cat.create ~name:"Sam" ()
let () = Cat.climb cat ~how_high:20 ()
let () = Cat.eat_part cat ~num_mice:0.2 ()
let () = Cat.eat cat ~num_mice:2 ()
let () = print_endline @@ Cat.to_string cat ()
let () = print_endline "done"
| null | https://raw.githubusercontent.com/mooreryan/ocaml_python_bindgen/02d59916f5ca58c7b00543cc126451297d5328fc/test/py_fun_name_attr.t/run.ml | ocaml | open! Base
open Lib
open Stdio
let () = Py.initialize ()
let cat = Cat.create ~name:"Sam" ()
let () = Cat.climb cat ~how_high:20 ()
let () = Cat.eat_part cat ~num_mice:0.2 ()
let () = Cat.eat cat ~num_mice:2 ()
let () = print_endline @@ Cat.to_string cat ()
let () = print_endline "done"
| |
063953bdf2e0260416c61785df0b647b5da93922b27d060cb70271420d5ce01e | biocad/openapi3 | AesonUtils.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE ExplicitForAll #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableSuperClasses #
module Data.OpenApi.Internal.AesonUtils (
-- * Generic functions
AesonDefaultValue(..),
sopSwaggerGen... | null | https://raw.githubusercontent.com/biocad/openapi3/e1ea5fedae3d411f0e413d54bf1f8dfa44bc1a94/src/Data/OpenApi/Internal/AesonUtils.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE ExplicitForAll #
* Generic functions
* Options
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
^ prefix
So far we use only default definitions
-----------------------------------... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableSuperClasses #
module Data.OpenApi.Internal.AesonUtils (
AesonDefaultValue(..),
sopSwaggerGenericToJSON,
sopSwaggerGenericToEncoding,
sopSwaggerGenericToJSONWithOpts,
... |
41ee710834b5a54005c320bb299e5f8a11a47b3b43fe927d1d5b159b0347fd38 | htmfilho/minimily | third_party.clj | (ns minimily.accounting.web.ui.third-party
(:require [hiccup.form :refer [form-to submit-button label text-field
hidden-field]]
[minimily.web.ui.layout :refer [layout]]
[minimily.web.ui.bootstrap :refer [show-field back-button... | null | https://raw.githubusercontent.com/htmfilho/minimily/ac27231b4b0e63a0dba747aa4dd972f39bb23ecd/src/minimily/accounting/web/ui/third_party.clj | clojure | (ns minimily.accounting.web.ui.third-party
(:require [hiccup.form :refer [form-to submit-button label text-field
hidden-field]]
[minimily.web.ui.layout :refer [layout]]
[minimily.web.ui.bootstrap :refer [show-field back-button... | |
eab54ea2ae10c1197ef71e8244450ea681b0f8f50397f0d8f9f67e271bf97ed5 | bnomis/om-next-datascript-localisation-demo | project.clj | (defproject om-next-datascript-localisation-demo "0.2.0-SNAPSHOT"
:description "Demo of Om Next and DataScript Localisation"
:url "-next-datascript-localisation-demo"
:license {:name "MIT"
:url ""}
:dependencies [ [org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.228"]... | null | https://raw.githubusercontent.com/bnomis/om-next-datascript-localisation-demo/be9a77e0a040896533f79f86cdbd115c19ab3c9f/project.clj | clojure | (defproject om-next-datascript-localisation-demo "0.2.0-SNAPSHOT"
:description "Demo of Om Next and DataScript Localisation"
:url "-next-datascript-localisation-demo"
:license {:name "MIT"
:url ""}
:dependencies [ [org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.228"]... | |
940bc593f2b50bb386d62070ab86184c54ab971eeb9c7e05dde169346dbfac44 | danilkolikov/dfl | PrettyPrinter.hs | |
Module : Compiler . Prettify . PrettyPrinter
Description : Pretty printer
Copyright : ( c ) , 2019
License : MIT
Pretty printer supporting custom indentation
Module : Compiler.Prettify.PrettyPrinter
Description : Pretty printer
Copyright : (c) Danil Kolikov, 2019
Licen... | null | https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Compiler/Prettify/PrettyPrinter.hs | haskell | | Multiple lines
| Object which does pretty printing
| Run pretty printer
| Return single line
| Make single line
| Return muliple lines
| Make multiple lines
| Return joined lines
| Join list of lines
| Join results of printers
| Join results on multiple lines
| Run printer with increased indentation | |
Module : Compiler . Prettify . PrettyPrinter
Description : Pretty printer
Copyright : ( c ) , 2019
License : MIT
Pretty printer supporting custom indentation
Module : Compiler.Prettify.PrettyPrinter
Description : Pretty printer
Copyright : (c) Danil Kolikov, 2019
Licen... |
f2eab3059fe706dd2a24dd6f00d0f943b4e3df7258feab476d6ca1edfbfe0d73 | tek/ribosome | Window.hs | -- |API functions for windows.
module Ribosome.Api.Window where
import Ribosome.Data.WindowView (PartialWindowView, WindowView)
import Ribosome.Host.Api.Data (Window)
import Ribosome.Host.Api.Data (
nvimBufGetOption,
nvimCallFunction,
nvimCommand,
nvimGetCurrentWin,
nvimWinClose,
nvimWinGetBuf,
nvimWinGe... | null | https://raw.githubusercontent.com/tek/ribosome/800642404ee8bf6e1d563ad3440d3e191e5be62d/packages/ribosome/lib/Ribosome/Api/Window.hs | haskell | |API functions for windows.
|Close a window if it is valid and not the last one.
|Redraw the screen.
|A main window means here any non-window that may be used to edit a file, i.e. one with an empty @buftype@.
Focuses the window.
|Call @winsaveview@.
|Call @winrestview@ with a previously obtained view from 'saveV... | module Ribosome.Api.Window where
import Ribosome.Data.WindowView (PartialWindowView, WindowView)
import Ribosome.Host.Api.Data (Window)
import Ribosome.Host.Api.Data (
nvimBufGetOption,
nvimCallFunction,
nvimCommand,
nvimGetCurrentWin,
nvimWinClose,
nvimWinGetBuf,
nvimWinGetCursor,
nvimWinSetCursor,
... |
a0f239c21cf85a827b5abbfe95d4051ecf0d4f24d0e289b2d11a91686854ef89 | moostang/autolisp | floor_ceil_functions_in_autolisp.lsp | ; -------------------------------------------------------------------------- ;
; -------------------------------------------------------------------------- ;
DEFINE FUNCTIONS FOR FLOOR AND
; -------------------------------------------------------------------------- ;
Floor and Ceil functions of FORTRAN , MATLAB in... | null | https://raw.githubusercontent.com/moostang/autolisp/e4f9e624175880a6383850bae58718c48e31ff43/floor_ceil_functions_in_autolisp.lsp | lisp | -------------------------------------------------------------------------- ;
-------------------------------------------------------------------------- ;
-------------------------------------------------------------------------- ;
-------------------------------------------------------------------------- ;
END O... | DEFINE FUNCTIONS FOR FLOOR AND
Floor and Ceil functions of FORTRAN , MATLAB in Autolisp . I use them alot !
EXAMPLES ( SIMILAR FOR )
_ $ ( floor 652.123 1 )
652
_ $ ( floor 652.123 10 )
650
_ $ ( floor 652.123 100 )
600
_ $ ( floor 652.123 1000 )
0
(defun floor (val Factor)
(fix (* Factor (fix (/ val ... |
c8c98d68831de34f900ffc121e8cfcd0e76996ce24cf77b4c6827dbc3bb4e48b | simongray/sino.study | data.cljc | (ns sinostudy.pinyin.data)
;; also includes special case initials w and y (technically not initials)
(def initials
#{"b" "p" "m" "f" "d" "t" "n" "l"
"g" "k" "h" "j" "q" "x" "z" "c"
"s" "zh" "ch" "sh" "r" "w" "y"})
;; includes all possible forms in use (e.g. "ue" as shorthand for "üe")
;; r is a common speci... | null | https://raw.githubusercontent.com/simongray/sino.study/b1b2954011841bc96449a1aa61eb51656930aee5/src/sinostudy/pinyin/data.cljc | clojure | also includes special case initials w and y (technically not initials)
includes all possible forms in use (e.g. "ue" as shorthand for "üe")
r is a common special case final (technically not a final)
m is a super rare, special case final
the index of a character correspond to the tone present at that index
m is a ... | (ns sinostudy.pinyin.data)
(def initials
#{"b" "p" "m" "f" "d" "t" "n" "l"
"g" "k" "h" "j" "q" "x" "z" "c"
"s" "zh" "ch" "sh" "r" "w" "y"})
(def finals
#{"a" "ai" "an" "ang" "ao"
"e" "ei" "en" "eng" "er"
"i" "ia" "ian" "iang" "iao" "ie" "in" "ing" "iong" "iu"
"m"
"o" "ong" "ou"
"r"
... |
505a92ddb5b5298aa0e0d37a911749a43710af7b1d073db740c65c5c1b0764a5 | kingcons/advent-of-code | parsers.lisp | (mgl-pax:define-package :aoc.parsers
(:use :cl :mgl-pax :esrap)
(:import-from :cl-ppcre #:split)
(:import-from :serapeum #:op))
(in-package :aoc.parsers)
(defsection @aoc.parsers (:title "Parsing Utilities")
(letter dislocated)
(digit dislocated)
(integer dislocated)
(whitespace dislocated)
(spaces di... | null | https://raw.githubusercontent.com/kingcons/advent-of-code/1528228c82401905fad40747347cdfe6719e1a23/src/parsers.lisp | lisp | (mgl-pax:define-package :aoc.parsers
(:use :cl :mgl-pax :esrap)
(:import-from :cl-ppcre #:split)
(:import-from :serapeum #:op))
(in-package :aoc.parsers)
(defsection @aoc.parsers (:title "Parsing Utilities")
(letter dislocated)
(digit dislocated)
(integer dislocated)
(whitespace dislocated)
(spaces di... | |
bcbe59e737d86bc2ae30750f23cb9c62a2aebe84a2be387ec0a3ba0e154969ab | danielmiladinov/joy-of-clojure | throwing_and_catching.clj | ;; Throwing and catching
;; ---------------------------------------------------------------------------------------------------------------------
We 'll now talk briefly about Clojure 's facilities for handling exceptions . Like , Clojure provides a couple of
;; forms for throwing and catching runtime exceptions: th... | null | https://raw.githubusercontent.com/danielmiladinov/joy-of-clojure/cad7d1851e153beb12a2cd536eb467be12cb7a73/src/joy-of-clojure/chapter2/throwing_and_catching.clj | clojure | Throwing and catching
---------------------------------------------------------------------------------------------------------------------
forms for throwing and catching runtime exceptions: throw and catch, respectively. Although throw and catch map
error handling.
The mechanism to throw an exception is fairly s... | We 'll now talk briefly about Clojure 's facilities for handling exceptions . Like , Clojure provides a couple of
almost directly down to Java and JavaScript , they 're considered the standard way of dealing with error handling .
In other words , even in the absence of interoperability , most Clojure code uses t... |
93739f0d43fdcd77f8a27567297c4a807ff6dcc8168a4a884d497d3e8155d076 | tweag/lagoon | JsonType.hs | Copyright 2020 Pfizer Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
-- -2.0
-- Unless required by applicable law or agreed to in writing, software
distributed under th... | null | https://raw.githubusercontent.com/tweag/lagoon/2ef0440db810f4f45dbed160b369daf41d92bfa4/src/interface/src/Lagoon/Interface/JsonType.hs | haskell | 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 KIND, either express or implied.
See the License for the specific language governing permiss... | Copyright 2020 Pfizer Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
# LANGUAGE TupleSections #
# LANGUAGE GeneralizedNewtypeDeriving #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Lagoon.Interface.Jso... |
a141ad5dd4ddf0187de8064b0fc8d10339a8953e7611ac1610283e2d57646278 | conal/Fran | Transform2B.hs | -- Transform behaviors
--
Last modified Mon Mar 23 11:19:23 1998
module Transform2B where
import qualified Transform2 as T
import Behavior
import Vector2B
infixr 7 *%, `compose2` -- transform apply and compose
type Transform2B = Behavior T.Transform2
factorTransform2B = lift1 T.factorTran... | null | https://raw.githubusercontent.com/conal/Fran/a113693cfab23f9ac9704cfee9c610c5edc13d9d/src/Transform2B.hs | haskell | Transform behaviors
transform apply and compose
| Last modified Mon Mar 23 11:19:23 1998
module Transform2B where
import qualified Transform2 as T
import Behavior
import Vector2B
type Transform2B = Behavior T.Transform2
factorTransform2B = lift1 T.factorTransform2
identity2 = lift0 T.identity2
translate2 = lift1 T.translate2
rotate2 = lift... |
06670e5a60488ecd4356f8c5c51bfae23a1af409995fb05f4a3ae198ce8bdde1 | PacktPublishing/Haskell-High-Performance-Programming | echo-lt.hs | -- file: echo-t.hs
import System.IO
import qualified Data.Text.Lazy.IO as T
main = T.getContents >>= T.putStr
| null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter06/echo-lt.hs | haskell | file: echo-t.hs |
import System.IO
import qualified Data.Text.Lazy.IO as T
main = T.getContents >>= T.putStr
|
c34e1707415b82cd5f0d1d23c119d2c7ba0918cf1a0d21e9d64d01fab47e6614 | BinaryAnalysisPlatform/bap-plugins | main.ml | open Core_kernel
open Option
open Bap.Std
open Microx.Std
open ARM
include Self()
open Poly
open Format
module SM = Monad.State
open SM.Let_syntax
open SM.Monad_infix
open Options
open Uaf_error
let rand32 lo hi = Int32.(Random.int32 (hi+(hi-lo)) + lo)
let rec generate = function
| `Fixed x -> Word.of_int32 x
|... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap-plugins/2e9aa5c7c24ef494d0e7db1b43c5ceedcb4196a8/uaf-checker/main.ml | ocaml | * Track addrs that have been free'd
* getters
* Since this gets called on a alloc_result, lookup the size
and inform data accordingly
* When we see a alloc, do the right things with def
for visual consistency and keeping track of original
alloc return values, assign this to the var too
look ... | open Core_kernel
open Option
open Bap.Std
open Microx.Std
open ARM
include Self()
open Poly
open Format
module SM = Monad.State
open SM.Let_syntax
open SM.Monad_infix
open Options
open Uaf_error
let rand32 lo hi = Int32.(Random.int32 (hi+(hi-lo)) + lo)
let rec generate = function
| `Fixed x -> Word.of_int32 x
|... |
e628b2925126b5b1cb5a3d0b5cbfc4c8328fcd3f27985acb1f97a54132db2d73 | zyrolasting/polyglot | develop.rkt | #lang racket/base
(provide develop)
(require
raco/command-name
racket/class
racket/function
racket/list
racket/cmdline
racket/file
setup/getinfo
unlike-assets/logging
unlike-assets
file-watchers
"../../main.rkt"
"../../paths.rkt"
"../server.rkt"
"shared.rkt")
(define (develop)
(define ti... | null | https://raw.githubusercontent.com/zyrolasting/polyglot/d27ca7fe90fd4ba2a6c5bcd921fce89e72d2c408/polyglot-lib/polyglot/private/cli/develop.rkt | racket | Some editors delete files for a brief moment
files are still gone. | #lang racket/base
(provide develop)
(require
raco/command-name
racket/class
racket/function
racket/list
racket/cmdline
racket/file
setup/getinfo
unlike-assets/logging
unlike-assets
file-watchers
"../../main.rkt"
"../../paths.rkt"
"../server.rkt"
"shared.rkt")
(define (develop)
(define ti... |
4caef657394e88d2c394d3c7daaf345b5b401dd7d45b65c8044073b0b814e4be | Eduap-com/WordMat | cosq1b.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ "
" f2cl2.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 95098eb54f13 2013/04/01 00:45:16 toy $... | null | https://raw.githubusercontent.com/Eduap-com/WordMat/83c9336770067f54431cc42c7147dc6ed640a339/Windows/ExternalPrograms/maxima-5.45.1/share/maxima/5.45.1/share/fftpack5/lisp/cosq1b.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp snapshot-2020-04 (21D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format single-float)) | ( " f2cl1.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ "
" f2cl2.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ "
" f2cl6.l , v 1d5cbacbb9... |
eda12ac86f2319e248fac09fb84d60086d791f566028e0da4b0e77c8af4affc0 | wotbrew/relic | expr.cljc | (ns com.wotbrew.relic.impl.expr
(:require [com.wotbrew.relic.impl.util :as u]
[com.wotbrew.relic.impl.relvar :as r]
#?(:clj [clojure.core :as clj]
:cljs [cljs.core :as clj]))
(:refer-clojure :exclude [< <= > >=]))
(def ^:dynamic *env-deps* nil)
(defn- track-env-dep [k]
(if... | null | https://raw.githubusercontent.com/wotbrew/relic/8e760851fe656a8bf91f32f54f4d6f671eed40ef/src/com/wotbrew/relic/impl/expr.cljc | clojure | not going to use keywords as I do not want
exfiltration to be possible using edn user input
unsafe ops are matched against sentinel vals
this avoids exfiltration via injection attack using
edn data | (ns com.wotbrew.relic.impl.expr
(:require [com.wotbrew.relic.impl.util :as u]
[com.wotbrew.relic.impl.relvar :as r]
#?(:clj [clojure.core :as clj]
:cljs [cljs.core :as clj]))
(:refer-clojure :exclude [< <= > >=]))
(def ^:dynamic *env-deps* nil)
(defn- track-env-dep [k]
(if... |
e8676c4c27e4e7ef9dbbeffbb7811b5d17fb41d8ac471e3e491bbf93c5285670 | wz1000/hie-lsp | hlint.hs | module Main where
import Control.Monad
import Language.Haskell.HLint3 (hlint)
import System.Directory
import System.Exit (exitFailure, exitSuccess)
import System.FilePath
import System.FilePath.Find
main :: IO ()
main = do
pwd <- getCurrentDirectory
let runHlint f = hlint $ f:
[ "--ignore=Redundant do"
... | null | https://raw.githubusercontent.com/wz1000/hie-lsp/dbb3caa97c0acbff0e4fd86fc46eeea748f65e89/reflex-0.6.1/test/hlint.hs | haskell | TODO: Someday fix all hints in tests, etc.
parse error when hlint runs | module Main where
import Control.Monad
import Language.Haskell.HLint3 (hlint)
import System.Directory
import System.Exit (exitFailure, exitSuccess)
import System.FilePath
import System.FilePath.Find
main :: IO ()
main = do
pwd <- getCurrentDirectory
let runHlint f = hlint $ f:
[ "--ignore=Redundant do"
... |
cde6769d9439518d3aea0faa9281c4eef6181783c0972478002975a6d478a947 | fp-works/2019-winter-Haskell-school | Scrabble.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Scrabble where
import Data.Char (toUpper)
newtype Score = Score Int
deriving (Eq, Ord, Show, Num)
getScore :: Score -> Int
getScore (Score i) = i
score :: Char -> Score
score 'A' = Score 1
score 'B' = Score 3
score 'C' = Score 3
score 'D' = Score 2
score '... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week7/zehua/src/Scrabble.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
module Scrabble where
import Data.Char (toUpper)
newtype Score = Score Int
deriving (Eq, Ord, Show, Num)
getScore :: Score -> Int
getScore (Score i) = i
score :: Char -> Score
score 'A' = Score 1
score 'B' = Score 3
score 'C' = Score 3
score 'D' = Score 2
score '... | |
d0406ae8962dfb7274f9915b69b022b7b06cc30c59a3067fc686458804447385 | mariari/Misc-ML-Scripts | Golden.hs | module Golden where
import Mari.Library
import qualified Test.Tasty as T
import qualified Test.Tasty.HUnit as T
absurdTestAll :: T.TestTree
absurdTestAll =
T.testGroup
"Two Failing test groups"
[ T.testCase "(2 T.@=? 3)" ((2 :: Integer) T.@=? 3),
T.testCase "(4 T.@=? 3)" ((4 :: Integer) T.@=? 3)
]... | null | https://raw.githubusercontent.com/mariari/Misc-ML-Scripts/376a7d55b565bf9205e697c5c3b78e1d6b6aedcd/Haskell/StandardLibrary/test/Golden.hs | haskell | module Golden where
import Mari.Library
import qualified Test.Tasty as T
import qualified Test.Tasty.HUnit as T
absurdTestAll :: T.TestTree
absurdTestAll =
T.testGroup
"Two Failing test groups"
[ T.testCase "(2 T.@=? 3)" ((2 :: Integer) T.@=? 3),
T.testCase "(4 T.@=? 3)" ((4 :: Integer) T.@=? 3)
]... | |
6cc1fcda9aea9606c4b008888370eadeffb6462e4e05ba8da54f0175b41ff31c | minoki/yurumath | Attributes.hs | DO NOT EDIT THIS FILE ! This file was generated by tools / GenerateMMLCombinators.hs .
{-# LANGUAGE OverloadedStrings #-}
module Text.YuruMath.Builder.MathML3.Attributes where
import Prelude ()
import Text.Blaze.Internal (Attribute, AttributeValue, attribute)
accent :: AttributeValue -> Attribute
accent = attribu... | null | https://raw.githubusercontent.com/minoki/yurumath/8529390f351654b3ea3157e2852497d0d09e7601/src/Text/YuruMath/Builder/MathML3/Attributes.hs | haskell | # LANGUAGE OverloadedStrings # | DO NOT EDIT THIS FILE ! This file was generated by tools / GenerateMMLCombinators.hs .
module Text.YuruMath.Builder.MathML3.Attributes where
import Prelude ()
import Text.Blaze.Internal (Attribute, AttributeValue, attribute)
accent :: AttributeValue -> Attribute
accent = attribute "accent" " accent=\""
accentund... |
0d2ffce443cf75ba12a3b2274820420f14effbeef03fe43d3da5d9f6c5be14f1 | exercism/clojure | proverb.clj | (ns proverb)
(defn recite [] ;; <- arglist goes here
;; your code goes here
)
| null | https://raw.githubusercontent.com/exercism/clojure/7ed96a5ae3c471c37db2602baf3db2be3b5a2d1a/exercises/practice/proverb/src/proverb.clj | clojure | <- arglist goes here
your code goes here | (ns proverb)
)
|
a6d0fbf3e64dd745f1b7888e500662ca89d4f37806e57d452efbd1b1f1cff1c3 | apache/couchdb-couch-replicator | couch_replicator_httpc_pool.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/apache/couchdb-couch-replicator/d00b981445c03622497088eb872059ab4f48b298/src/couch_replicator_httpc_pool.erl | erlang | 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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(couch_replicator_httpc_pool).
-behaviour(gen_server).
-vsn(1).
-export([start_link/2, stop/1]).
-export([get_worker/1, release_worker/2, release_wo... |
3f7a72551f44270401120426007e1c52a8d1125b8162fe228f2dea433aae974c | Haskell-Things/ImplicitCAD | Implicit.hs | {- ORMOLU_DISABLE -}
Implicit CAD . Copyright ( C ) 2011 , ( )
Copyright ( C ) 2014 2015 2016 , ( )
-- Released under the GNU AGPLV3+, see LICENSE
{- The purpose of this file is to pass on the functionality we want
to be accessible to an end user who is compiling objects using
this haskell library. -}
... | null | https://raw.githubusercontent.com/Haskell-Things/ImplicitCAD/ae794b901e9677593815fad741d87ff56846562d/Graphics/Implicit.hs | haskell | ORMOLU_DISABLE
Released under the GNU AGPLV3+, see LICENSE
The purpose of this file is to pass on the functionality we want
to be accessible to an end user who is compiling objects using
this haskell library.
* Types
* Shared operations
* 2D primitive shapes
* 2D operations
* 3D primitive shapes
* 3D o... | Implicit CAD . Copyright ( C ) 2011 , ( )
Copyright ( C ) 2014 2015 2016 , ( )
module Graphics.Implicit (
W.ℝ,
W.ℝ2,
W.ℝ3,
SymbolicObj2 (),
SymbolicObj3 (),
W.ExtrudeMScale(C1, C2, Fn),
P.Object (),
P.translate,
P.scale,
P.mirror,
P.complement,
P.union,
P.unionR,
P.intersect,
... |
d5b8c24a4ae132ec606dc2d7cb5effb2add18f0ca04a11ea392e8646fc6219fd | kostmo/circleci-failure-tracker | GithubApiFetch.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
module GithubApiFetch (
... | null | https://raw.githubusercontent.com/kostmo/circleci-failure-tracker/393d10a72080bd527fdb159da6ebfea23fcd52d1/app/fetcher/src/GithubApiFetch.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TypeFamilies #
of the result set, so we can optimistically fetch a small number
of results to reduce bandwidth.
| Returns an error if the commit chain is not linear,
otherwise... | # LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
module GithubApiFetch (
getBuildStatuses
, getCommitsNewestFirst
, findAncestor
, GitHubApiSupport (..)
, CommitsFetchError (..)
, fetchUser
, getPullRequestAuthor
, PullRequestRespo... |
f73514c753305125f200387dac784ba44f9c790b92db4b3d4a8e6858326efa5e | redink/task | task.erl | -module(task).
-export([async/3,
async/4,
async/1,
async/2,
await/1,
await/2]).
-export([async_opt/4,
async_opt/5,
async_opt/2,
async_opt/3]).
-export([safe_await/2,
safe_await/3]).
-export([async_do/3]).
-spec async(function()) -> {p... | null | https://raw.githubusercontent.com/redink/task/7a5977e4c4c7d6e1a835fcedbd99f58b1f0c1200/src/task.erl | erlang | -module(task).
-export([async/3,
async/4,
async/1,
async/2,
await/1,
await/2]).
-export([async_opt/4,
async_opt/5,
async_opt/2,
async_opt/3]).
-export([safe_await/2,
safe_await/3]).
-export([async_do/3]).
-spec async(function()) -> {p... | |
24809fbc824e82073061d7224a618a73d56c6c45077db2881eb44ccbc3ae8022 | dgiot/dgiot | dgiot_udpc_worker.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2021 DGIOT Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy... | null | https://raw.githubusercontent.com/dgiot/dgiot/a6b816a094b1c9bd024ce40b8142375a0f0289d8/apps/dgiot_bridge/src/channel/dgiot_udpc_worker.erl | erlang | --------------------------------------------------------------------
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 KIND, either express ... | Copyright ( c ) 2020 - 2021 DGIOT Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(dgiot_udpc_worker).
-author("johnliu").
-include_lib("dgiot/include/dgiot_socket.hrl")... |
7098515a87242ffdbdaee63fcd641c14db0422cce5d6d0f4e2d5b67940d19778 | deadpendency/deadpendency | ProcessingError.hs | module Common.Model.Error.ProcessingError
( ProcessingError (..),
)
where
import Common.Aeson.Aeson
import Common.Model.Error.UserError
import Data.Aeson
data ProcessingError
= ProcessingErrorApplication
| ProcessingErrorUser UserError
deriving stock (Eq, Show, Generic)
instance ToJSON ProcessingError wher... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Model/Error/ProcessingError.hs | haskell | module Common.Model.Error.ProcessingError
( ProcessingError (..),
)
where
import Common.Aeson.Aeson
import Common.Model.Error.UserError
import Data.Aeson
data ProcessingError
= ProcessingErrorApplication
| ProcessingErrorUser UserError
deriving stock (Eq, Show, Generic)
instance ToJSON ProcessingError wher... | |
4e2b56efb175cf2dc1e05cfd30e113fdf22ec53d1a662e32155934634345ae3d | khafatech/rsc3 | filters.rkt | #lang racket
(require oregano)
;; press 'a'
(make-instrument "my-inst" ([freq 500])
(mul (sin-osc ar (mul-add (lf-pulse ar (mouse/x 5 500) 0 0.5) 200 freq) 0)
(mouse-button kr 0 0 0)))
(define phone-note (play-note "my-inst" 600))
(define track0 0)
(sleep 1)
(reverb track0 0... | null | https://raw.githubusercontent.com/khafatech/rsc3/a25985dab29ad951893cd7afa6d86a9371315871/oregano/examples/filters.rkt | racket | press 'a' | #lang racket
(require oregano)
(make-instrument "my-inst" ([freq 500])
(mul (sin-osc ar (mul-add (lf-pulse ar (mouse/x 5 500) 0 0.5) 200 freq) 0)
(mouse-button kr 0 0 0)))
(define phone-note (play-note "my-inst" 600))
(define track0 0)
(sleep 1)
(reverb track0 0.5)
(sleep 3... |
03758049229eda69d34d8742059f0428c612e0f42b93fa8d3bf673798a130733 | ghcjs/ghcjs | genNewtype.hs | # LANGUAGE DeriveGeneric #
module Main where
import GHC.Generics
data X = X deriving Generic
newtype Y = Y X deriving Generic
main = print [isNewtype (from X), isNewtype (from (Y X))]
| null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/generics/genNewtype.hs | haskell | # LANGUAGE DeriveGeneric #
module Main where
import GHC.Generics
data X = X deriving Generic
newtype Y = Y X deriving Generic
main = print [isNewtype (from X), isNewtype (from (Y X))]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.