_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 |
|---|---|---|---|---|---|---|---|---|
e7b8e91832683efa69cf2daa05d9ec6cb255ff1b5c18ca802ad1a50481560dbe | murbard/plebeia | dumb.mli | type segment = Plebeia.Plebeia_impl.Path.side list
type value = Plebeia.Plebeia_impl.value
type context = unit
type error = string
type t
type cursor
val get_root_node : cursor -> t
val empty : context -> cursor
(** Creates a cursor to a new, empty tree. *)
val subtree : cursor -> segment -> (cursor, error) result... | null | https://raw.githubusercontent.com/murbard/plebeia/95a0eed6f7b8c6836d15032557467a3e93bd83b8/tests/dumb.mli | ocaml | * Creates a cursor to a new, empty tree.
* Moves the cursor down a segment, to the root of a sub-tree. Think
"cd segment/"
* Create a subtree (bud). Think "mkdir segment"
* Moves the cursor back to the parent tree. Think "cd .."
* Gets a value if present in the current tree at the given
segment.
* Inserts ... | type segment = Plebeia.Plebeia_impl.Path.side list
type value = Plebeia.Plebeia_impl.value
type context = unit
type error = string
type t
type cursor
val get_root_node : cursor -> t
val empty : context -> cursor
val subtree : cursor -> segment -> (cursor, error) result
val create_subtree: cursor -> segment -> (cu... |
20a2df98c93011dac4ff7849946480fc878d4b48deaec07014854482bd7edef6 | klutometis/clrs | 6.5-1.scm | (require-extension syntax-case
check)
(require 'section)
(import section-6.5)
(require '../6.2/section)
(import* section-6.2
make-heap
heap-data)
(let* ((data '(15 13 9 5 12 8 7 4 0 6 2 1))
(heap (make-heap data (length data))))
(check (heap-extract-max heap)
=> 1... | null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/6.5/6.5-1.scm | scheme | (require-extension syntax-case
check)
(require 'section)
(import section-6.5)
(require '../6.2/section)
(import* section-6.2
make-heap
heap-data)
(let* ((data '(15 13 9 5 12 8 7 4 0 6 2 1))
(heap (make-heap data (length data))))
(check (heap-extract-max heap)
=> 1... | |
83256c1dd775b4b51f0ca2f454cc4da7d97e410504d424cd65f5d37f28843341 | dcSpark/fracada-il-primo | EvilEndpoints.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ImportQualifiedPost #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LA... | null | https://raw.githubusercontent.com/dcSpark/fracada-il-primo/0400e8f7d465d309d9638eb4a50eede2fed4effb/test/Spec/EvilEndpoints.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
try to mint more than what's declared in the datum
pay minted tokens back to signer
find the minting script instance
define the value to mint (amount of... | # LANGUAGE DeriveGeneric #
# LANGUAGE ImportQualifiedPost #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Spec.EvilEndpoints where
import ... |
666b6b823b9c53ef744c4a75647e8fe8c829cc95a7d44c8eac7158ddd563c8a4 | charlieg/Sparser | review-results.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1994 -- all rights reserved
;;;
;;; File: "review results"
;;; Module: "interface;SUN:"
Version : December 1994
initiated 12/13/94
(in-package :sparser)
| null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/interface/SUN/review-results.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "review results"
Module: "interface;SUN:" | copyright ( c ) 1994 -- all rights reserved
Version : December 1994
initiated 12/13/94
(in-package :sparser)
|
e974870f0cbd615a2ef3d9f47641e9f061386150f537e5a98048c98f237bcc00 | shiguredo/swidden | swidden_middleware.erl | -module(swidden_middleware).
-export([failure/2, failure/3]).
failure(Req, Type) when is_binary(Type) ->
cowboy_req:reply(400, #{<<"content-type">> => <<"application/json">>},
jsone:encode(#{error_type => Type}), Req).
failure(Req, Type, Reason) when is_binary(Type) andalso is_map(Reason) ... | null | https://raw.githubusercontent.com/shiguredo/swidden/faec93ae6b6c9e59840f0df22c5f72e381b54c02/src/swidden_middleware.erl | erlang | -module(swidden_middleware).
-export([failure/2, failure/3]).
failure(Req, Type) when is_binary(Type) ->
cowboy_req:reply(400, #{<<"content-type">> => <<"application/json">>},
jsone:encode(#{error_type => Type}), Req).
failure(Req, Type, Reason) when is_binary(Type) andalso is_map(Reason) ... | |
b5a27e8bf567452aa1eaf6eb0140059b898ee669f0f5267e60253cadc40f8b75 | ros/roslisp_common | comm-state-machine.lisp | Copyright ( c ) 2014 , < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list of conditions... | null | https://raw.githubusercontent.com/ros/roslisp_common/4db311da26497d84a147f190200e50c7a5b4106e/actionlib_lisp/src/new_implementation/comm-state-machine.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in ... | Copyright ( c ) 2014 , < >
* Neither the name of the Institute for Artificial Intelligence/
Universitaet Bremen nor the names of its contributors may be used to
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR P... |
033fc2259aa5767f8480df0d4f1427c1c110f2e675873a5fa5df97c8c2852fdf | racket/typed-racket | sealing-contract-2.rkt | #;
(exn-pred #rx"superclass already contains")
#lang racket/base
(module u racket
;; adds m instead of n like the spec says
(define (mixin cls)
(class cls
(super-new)
(define/public (m x) x)))
(provide mixin))
(module t typed/racket/optional
;; expects a mixin that adds n
(require/typed (su... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/fail/optional/sealing-contract-2.rkt | racket |
adds m instead of n like the spec says
expects a mixin that adds n | (exn-pred #rx"superclass already contains")
#lang racket/base
(module u racket
(define (mixin cls)
(class cls
(super-new)
(define/public (m x) x)))
(provide mixin))
(module t typed/racket/optional
(require/typed (submod ".." u)
[mixin
(All (r #:row)
... |
d6ad18f51f5e77c150f1c4fa3bda1b92cbc70edd25353c198615dc1b5587e65c | advancedtelematic/quickcheck-state-machine | Parallel.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE ScopedTypeVariables #
-----------------------------------------------------------------------------
-- |
-- Module : Test.StateMachine.Parallel
Copyright : ( C ) 2017 , ATS Advanced Telem... | null | https://raw.githubusercontent.com/advancedtelematic/quickcheck-state-machine/3cbf466db302235afdea91dac06a57b8fe0f0b4d/src/Test/StateMachine/Parallel.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE Rank2Types #
---------------------------------------------------------------------------
|
Module : Test.StateMachine.Parallel
License : BSD-style (see the file LICENSE)
Stability : provisional
This module contains helpers for generating, shrinki... | # LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
Copyright : ( C ) 2017 , ATS Advanced Telematic Systems GmbH
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Test.StateMachine.Parallel
( forAllNParallelCommands
, forAllParallelCommands
, generateNPar... |
e83f1ae84be881e81096d2573a363114fc1060cdf8dd8f16f384d319affb960a | hcarty/ezmysql | ezmysql.ml | module Datetime = CalendarLib.Calendar.Precise
module Date = Datetime.Date
module Time = Datetime.Time
module Row = struct
include Map.Make (String)
let keys m = to_seq m |> Seq.map fst |> List.of_seq
let values m = to_seq m |> Seq.map snd |> List.of_seq
end
module Datetime_p = CalendarLib.Printer.Precise_Calen... | null | https://raw.githubusercontent.com/hcarty/ezmysql/06dd0536ebb95c3d3767bdcf927a63a03547b733/src/ezmysql.ml | ocaml | The database name to use is the path without the '/' prefix
If a column is specified, make sure last_insert_id identifies that
value once/if this insert completes successfully.
Assume things were broken and we need to remake the statement
Graph vertices are tables, unique by name
Persistent (immutab... | module Datetime = CalendarLib.Calendar.Precise
module Date = Datetime.Date
module Time = Datetime.Time
module Row = struct
include Map.Make (String)
let keys m = to_seq m |> Seq.map fst |> List.of_seq
let values m = to_seq m |> Seq.map snd |> List.of_seq
end
module Datetime_p = CalendarLib.Printer.Precise_Calen... |
3c5c8e929a196ac893d9f20becf3209025234727c8fc0affe321e658e72914b6 | rzezeski/try-try-try | rts_get_fsm.erl | %% @doc The coordinator for stat get operations. The key here is to
generate the preflist just like in wrtie_fsm and then query each
%% replica and wait until a quorum is met.
-module(rts_get_fsm).
-behavior(gen_fsm).
-include("rts.hrl").
%% API
-export([start_link/4, get/2]).
%% Callbacks
-export([init/1, code_ch... | null | https://raw.githubusercontent.com/rzezeski/try-try-try/c5d99f29fb3380f8653efdd1aa6a8f52143a9717/2011/riak-core-the-coordinator/rts/src/rts_get_fsm.erl | erlang | @doc The coordinator for stat get operations. The key here is to
replica and wait until a quorum is met.
API
Callbacks
===================================================================
API
===================================================================
=======================================================... | generate the preflist just like in wrtie_fsm and then query each
-module(rts_get_fsm).
-behavior(gen_fsm).
-include("rts.hrl").
-export([start_link/4, get/2]).
-export([init/1, code_change/4, handle_event/3, handle_info/3,
handle_sync_event/4, terminate/3]).
States
-export([prepare/2, execute/2, waiting... |
4512b2925c68919e7fec598d025bd073238072a983a9455282b61b2e39b403a6 | kostmo/circleci-failure-tracker | Routes.hs | {-# LANGUAGE OverloadedStrings #-}
module Routes where
import Control.Monad (unless, when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except (ExceptT (ExceptT), except,
runExceptT)
im... | null | https://raw.githubusercontent.com/kostmo/circleci-failure-tracker/393d10a72080bd527fdb159da6ebfea23fcd52d1/app/webservice/src/Routes.hs | haskell | # LANGUAGE OverloadedStrings #
^ for updating materialized views
For debugging only
XXX IMPORTANT:
The session cookie is specific to the parent dir of the path.
So with the path "/api/callback", only HTTP accesses to paths
Consequentially, a cookie set (namely, the github access token)
in a request to a certain ... |
module Routes where
import Control.Monad (unless, when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except (ExceptT (ExceptT), except,
runExceptT)
import Control.Monad.Trans.... |
4684cfe86de57ba4093002ce26d5e60d0148cd2f2236eb24d2596f8be8c8ed90 | lortabac/ariel | Prim.hs | {-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
module Ariel.Common.Prim where
import Ariel.Prelude
data Prim a
= Equal a a
| Lt a a
| Plus a a
| Minus a a
deriving (Eq, Show, Functor, Foldable, Traversable)
readPrim :: Text -> [a] -> Maybe (Prim a)
readPr... | null | https://raw.githubusercontent.com/lortabac/ariel/3c4e115a7fed724ed129e3b7056cc67751e3d35b/src/Ariel/Common/Prim.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE OverloadedStrings #
# LANGUAGE StrictData # |
module Ariel.Common.Prim where
import Ariel.Prelude
data Prim a
= Equal a a
| Lt a a
| Plus a a
| Minus a a
deriving (Eq, Show, Functor, Foldable, Traversable)
readPrim :: Text -> [a] -> Maybe (Prim a)
readPrim "=" [e1, e2] = Just $ Equal e1 e2
readPrim "<" [e1, e2] = Just $ Lt e1 e2
readPrim "+" [e1, e2]... |
db1674c407fda9f62ba599c2eeef96319cf2be94ee1e7caecf102c9d03a3f1fd | grin-compiler/ghc-whole-program-compiler-project | PrimOpMutVarSpec.hs | # LANGUAGE LambdaCase , QuasiQuotes , OverloadedStrings #
module PrimOpMutVarSpec where
import qualified Data.Text as Text
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.List (sort)
import Data.IORef
import Test.Hspec
import Test.QuickCheck
import System.IO
import Text.Show.Pretty (pPrin... | null | https://raw.githubusercontent.com/grin-compiler/ghc-whole-program-compiler-project/6663f0ee905e19ac126db0045025e49b6d387cca/lambda/test/PrimOpMutVarSpec.hs | haskell | --------------------------
-------------------------- | # LANGUAGE LambdaCase , QuasiQuotes , OverloadedStrings #
module PrimOpMutVarSpec where
import qualified Data.Text as Text
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.List (sort)
import Data.IORef
import Test.Hspec
import Test.QuickCheck
import System.IO
import Text.Show.Pretty (pPrin... |
049e60c49170db5d8f846106e0e8cd1fecbe38944b7cb67afe511f67dd614e70 | potatosalad/erlang-jose | emc_testvector.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2022 ,
%%% @doc
%%%
%%% @end
Created : 12 Aug 2015 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/dbc4074066080692246afe613345ef6becc2a3fe/test/cavp_SUITE_data/emc_testvector.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
===================================================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2022 ,
Created : 12 Aug 2015 by < >
-module(emc_testvector).
-export([from_binary/1]).
-export([from_file/1]).
-export([to_binary/1]).
-export([to_file/2]).
from_binary(Binary) ->
Lines = ... |
e9bf38bcc98fbe24c0bda4f94b521d23f61c53ba2eddc713c65bfb4f4f2a3958 | 8c6794b6/guile-tjit | active-slot.scm | ;;; installed-scm-file
Copyright ( C ) 1999 , 2001 , 2006 , 2009 , 2015 Free Software Foundation , Inc.
Copyright ( C ) 1993 - 1998 / ESSI < >
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
License as published by the... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/oop/goops/active-slot.scm | scheme | installed-scm-file
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PART... |
Copyright ( C ) 1999 , 2001 , 2006 , 2009 , 2015 Free Software Foundation , Inc.
Copyright ( C ) 1993 - 1998 / ESSI < >
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth F... |
9a79597fcb83fed3adff5c19be6787137a9198de3b74df2cc08968a54ac23237 | tsloughter/kuberl | kuberl_v1_priority_class_list.erl | -module(kuberl_v1_priority_class_list).
-export([encode/1]).
-export_type([kuberl_v1_priority_class_list/0]).
-type kuberl_v1_priority_class_list() ::
#{ 'apiVersion' => binary(),
'items' := list(),
'kind' => binary(),
'metadata' => kuberl_v1_list_meta:kuberl_v1_list_meta()
}.
encode(#... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_priority_class_list.erl | erlang | -module(kuberl_v1_priority_class_list).
-export([encode/1]).
-export_type([kuberl_v1_priority_class_list/0]).
-type kuberl_v1_priority_class_list() ::
#{ 'apiVersion' => binary(),
'items' := list(),
'kind' => binary(),
'metadata' => kuberl_v1_list_meta:kuberl_v1_list_meta()
}.
encode(#... | |
0de227dd11de757f4cf034ef1ccf4753795c38100b96d091364f17440c26204e | clojure-interop/java-jdk | JAXBPermission.clj | (ns javax.xml.bind.JAXBPermission
"This class is for JAXB permissions. A JAXBPermission
contains a name (also referred to as a \"target name\") but
no actions list; you either have the named permission
or you don't.
The target name is the name of the JAXB permission (see below).
The following table list... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/bind/JAXBPermission.clj | clojure | you either have the named permission | (ns javax.xml.bind.JAXBPermission
"This class is for JAXB permissions. A JAXBPermission
contains a name (also referred to as a \"target name\") but
or you don't.
The target name is the name of the JAXB permission (see below).
The following table lists all the possible JAXBPermission target names,
and fo... |
4798d58bed8b77c0f6c7e3e09cbeb170d9d6f57eda38c1635f1a98af31a0d1c4 | haskell-game/fungen | Display.hs | {-# OPTIONS_HADDOCK hide #-}
{- | This FunGEn module renders the game window.
-}
FunGEN - Functional Game Engine
/~haskell/fungen
Copyright ( C ) 2002 < >
This code is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANT... | null | https://raw.githubusercontent.com/haskell-game/fungen/fcf533d49fd3a0d9c1640faf6fd7d3a2f742083b/Graphics/UI/Fungen/Display.hs | haskell | # OPTIONS_HADDOCK hide #
| This FunGEn module renders the game window.
display callback that steps the game and renders its resulting
|
FunGEN - Functional Game Engine
/~haskell/fungen
Copyright ( C ) 2002 < >
This code is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
FunGEN - Functional Game Engine... |
88d1024913ae30a19321041e35f66e00619cd3b262b9fc88429fbfd480965a16 | mzp/ocaml-hoogle | base.ml | external (@@) : ('a -> 'b) -> 'a -> 'b = "%apply"
external (+>) : 'a -> ('a -> 'b) -> 'b = "%revapply"
let ($) f g x = f (g x)
let (!$) = Lazy.force
external id : 'a -> 'a = "%identity"
let uncurry f a b = f (a,b)
let curry f (a,b) = f a b
let flip f a b = f b a
let const a _ = a
let sure f =
function
Some x... | null | https://raw.githubusercontent.com/mzp/ocaml-hoogle/dbfb2e970d65e41936baa0ba51c7f7596cc6c369/base.ml | ocaml | external (@@) : ('a -> 'b) -> 'a -> 'b = "%apply"
external (+>) : 'a -> ('a -> 'b) -> 'b = "%revapply"
let ($) f g x = f (g x)
let (!$) = Lazy.force
external id : 'a -> 'a = "%identity"
let uncurry f a b = f (a,b)
let curry f (a,b) = f a b
let flip f a b = f b a
let const a _ = a
let sure f =
function
Some x... | |
4a27c54dda8cf5b3fe35cef1412ecca1ca059e918d06caa72e7de31f99aa63bc | owainlewis/ocaml-datastructures-algorithms | graph.ml | (* Graph Algorithms *)
(* Set would be a better choice here for when I get some time *)
module DiGraph = struct
exception VertexDoesNotExist
exception Cyclic of string
TODO parameterize this module
type t = string
type vertex = V of t * (t list ref)
type graph = vertex list ref
let create() = ref []
le... | null | https://raw.githubusercontent.com/owainlewis/ocaml-datastructures-algorithms/4696fa4f5a015fc18e903b0b9ba2a1a8013a40ce/archive/graph.ml | ocaml | Graph Algorithms
Set would be a better choice here for when I get some time
Todo in theory we can't reach this case
Builds a directed graph from a list of edge pairs i.e [(1,2);(2,3)] etc
A graph represented as a mutable list of vertices
A graph vertex in the form (v, incoming, outgoing)
An edge in the for... |
module DiGraph = struct
exception VertexDoesNotExist
exception Cyclic of string
TODO parameterize this module
type t = string
type vertex = V of t * (t list ref)
type graph = vertex list ref
let create() = ref []
let ident v = let V (x, _) = v in x
let vertices g = List.map ident !g
let has_vertex ... |
5ba6d787330a9cd2ca2ea11e96f1b4dd4731caf2048d542bedf29b7ee1e4eb4a | feeley/etos | build-parser.scm | ; file: "build-parser.scm"
(display "Building \"erlang.scm\"...")
;; To avoid annoying warning at compile-time.
;; important not to put this after the include...
;; Gambit would see it as a constant(block flag)
(define erlang-grammar #f)
(include "lalr-scm/lalr.scm")
(load "grammar.scm")
(gen-lalr1 erlang-grammar ... | null | https://raw.githubusercontent.com/feeley/etos/da9f089c1a7232d97827f8aa4f4b0862b7c5551f/compiler/build-parser.scm | scheme | file: "build-parser.scm"
To avoid annoying warning at compile-time.
important not to put this after the include...
Gambit would see it as a constant(block flag) |
(display "Building \"erlang.scm\"...")
(define erlang-grammar #f)
(include "lalr-scm/lalr.scm")
(load "grammar.scm")
(gen-lalr1 erlang-grammar "erlang.scm")
(display "done.") (newline)
|
def26508ba34fa0e4a0afd3e1866c3db30552c0461f677f96b29768dbe9c4dad | haskell/hackage-security | Repository.hs | -- | Abstract definition of a Repository
--
-- Most clients should only need to import this module if they wish to define
-- their own Repository implementations.
# LANGUAGE CPP #
module Hackage.Security.Client.Repository (
-- * Files
Metadata -- type index (really a kind)
, Binary -- type index (really a... | null | https://raw.githubusercontent.com/haskell/hackage-security/d1a13b02f5ea0bbb075c080e956eaeee06eca97d/hackage-security/src/Hackage/Security/Client/Repository.hs | haskell | | Abstract definition of a Repository
Most clients should only need to import this module if they wish to define
their own Repository implementations.
* Files
type index (really a kind)
type index (really a kind)
* Repository proper
** Downloaded files
** Helpers
* Paths
* Utility
--------------------------... | # LANGUAGE CPP #
module Hackage.Security.Client.Repository (
, RemoteFile(..)
, CachedFile(..)
, IndexFile(..)
, remoteFileDefaultFormat
, remoteFileDefaultInfo
, Repository(..)
, AttemptNr(..)
, LogMessage(..)
, UpdateFailure(..)
, SomeRemoteError(..)
, DownloadedFile(..)
, mirrorsUnsupported
... |
99c58905491f6b5c3154d37cac5867a78b802d0c5e03c76cfbb56e9b40eaa736 | jbreindel/battlecraft | bc_query_util.erl |
-module(bc_query_util).
-include_lib("stdlib/include/qlc.hrl").
-export([mnesia_query/3]).
mnesia_query(Gen, Offset, Limit) ->
mnesia:transaction(fun() ->
Qh = Gen(),
if Offset > 0 ->
qlc:next_answers(Qh, Offset);
true ->
ok
end,
qlc:next_answers(Qh, Limi... | null | https://raw.githubusercontent.com/jbreindel/battlecraft/622131a1ad8c46f19cf9ffd6bf32ba4a74ef4137/apps/bc_model/src/bc_query_util.erl | erlang |
-module(bc_query_util).
-include_lib("stdlib/include/qlc.hrl").
-export([mnesia_query/3]).
mnesia_query(Gen, Offset, Limit) ->
mnesia:transaction(fun() ->
Qh = Gen(),
if Offset > 0 ->
qlc:next_answers(Qh, Offset);
true ->
ok
end,
qlc:next_answers(Qh, Limi... | |
fd812aa58c569acfab79dded34a09a6f16de21bd76e462848511ae5a82b6cec7 | dwayne/eopl3 | senv.test.rkt | #lang racket
(require "./senv.rkt")
(require rackunit)
(let ([senv (extend-senv
'd
(extend-senv
'y
(extend-senv-rec
'f
(extend-senv
'x
(extend-senv
'y
(empty-senv)))))... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/03-ch3/interpreters/racket/NAMELESS-PROC-3.40/senv.test.rkt | racket | #lang racket
(require "./senv.rkt")
(require rackunit)
(let ([senv (extend-senv
'd
(extend-senv
'y
(extend-senv-rec
'f
(extend-senv
'x
(extend-senv
'y
(empty-senv)))))... | |
64665258f2c974f1a64f5c96656d3ce03ea2045310c27fff60e03858f410632e | anoma/juvix | Positive.hs | module Asm.Run.Positive where
import Asm.Run.Base
import Base
data PosTest = PosTest
{ _name :: String,
_relDir :: Path Rel Dir,
_file :: Path Rel File,
_expectedFile :: Path Rel File
}
root :: Path Abs Dir
root = relToProject $(mkRelDir "tests/Asm/positive")
testDescr :: PosTest -> TestDescr
testDe... | null | https://raw.githubusercontent.com/anoma/juvix/fab40c6c9932cc12592fbacc54fac1ddcd3b2228/test/Asm/Run/Positive.hs | haskell | module Asm.Run.Positive where
import Asm.Run.Base
import Base
data PosTest = PosTest
{ _name :: String,
_relDir :: Path Rel Dir,
_file :: Path Rel File,
_expectedFile :: Path Rel File
}
root :: Path Abs Dir
root = relToProject $(mkRelDir "tests/Asm/positive")
testDescr :: PosTest -> TestDescr
testDe... | |
468e3dfdf5e4e3032fea356ba1918394a4ffea73dc54ab90e0decb69ff98af7f | parapluu/Concuerror | autocomplete_common.erl | -module(autocomplete_common).
-export([test/2, test/3]).
-include_lib("stdlib/include/assert.hrl").
test(Command, Data) ->
test(Command, Data, []).
test(Command, Data, Options) ->
try
main(Command, Data, Options)
catch
C:R ->
io:format(standard_error, "Class: ~p~nReason: ~p~n", [C, R]),
ha... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests-real/suites/options/autocomplete/autocomplete_common.erl | erlang | -module(autocomplete_common).
-export([test/2, test/3]).
-include_lib("stdlib/include/assert.hrl").
test(Command, Data) ->
test(Command, Data, []).
test(Command, Data, Options) ->
try
main(Command, Data, Options)
catch
C:R ->
io:format(standard_error, "Class: ~p~nReason: ~p~n", [C, R]),
ha... | |
2eaba0956ecd8b85f6b68a8fa57fbddca36dfa6800a6bb009d7ea658168454cc | teamwalnut/graphql-ppx | result_structure.ml | type exhaustive_flag = Exhaustive | Nonexhaustive
type loc = Source_pos.ast_location
type name = string Source_pos.spanning
type field_result =
| Fr_named_field of {
name : string;
loc_key : loc;
loc : loc;
type_ : t;
arguments : Graphql_ast.arguments;
}
| Fr_fragment_spread of {
... | null | https://raw.githubusercontent.com/teamwalnut/graphql-ppx/8276452ebe8d89a748b6b267afc94161650ab620/src/graphql_compiler/result_structure.ml | ocaml | type exhaustive_flag = Exhaustive | Nonexhaustive
type loc = Source_pos.ast_location
type name = string Source_pos.spanning
type field_result =
| Fr_named_field of {
name : string;
loc_key : loc;
loc : loc;
type_ : t;
arguments : Graphql_ast.arguments;
}
| Fr_fragment_spread of {
... | |
d265a59410ad2a44f369c5625b4ae49fef9cb6c1f221ddd6ebb246194d5372a2 | jtdaugherty/tracy | Box.hs | module Tracy.Objects.Box
( box
)
where
import Linear
import Tracy.Types
import Tracy.BoundingBox
import Tracy.Util
box :: Material -> Object
box m =
let bbox = boundingBox (V3 (-0.5) (-0.5) (-0.5)) (V3 0.5 0.5 0.5)
in Object { _objectMaterial = m
, _hit = hitBox bbox m
, _sh... | null | https://raw.githubusercontent.com/jtdaugherty/tracy/ad36ea16a3b9cda5071ca72374d6e1c1b415d520/src/Tracy/Objects/Box.hs | haskell | module Tracy.Objects.Box
( box
)
where
import Linear
import Tracy.Types
import Tracy.BoundingBox
import Tracy.Util
box :: Material -> Object
box m =
let bbox = boundingBox (V3 (-0.5) (-0.5) (-0.5)) (V3 0.5 0.5 0.5)
in Object { _objectMaterial = m
, _hit = hitBox bbox m
, _sh... | |
b1601d2b158456b9280b48e964a40a620ae50d5d11dba52b4f52c81a545d31a8 | eamsden/Animas | AFRPTestsDer.hs | $ I d : AFRPTestsDer.hs , v 1.2 2003/11/10 21:28:58 antony Exp $
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... | null | https://raw.githubusercontent.com/eamsden/Animas/2404d1de20982a337109fc6032cb77b022514f9d/tests/AFRPTestsDer.hs | haskell | ----------------------------------------------------------------------------
Test cases for derivative
----------------------------------------------------------------------------
For stepsize 0.1
For stepsize 0.1
We're happy if we are in the right ball park. | $ I d : AFRPTestsDer.hs , v 1.2 2003/11/10 21:28:58 antony Exp $
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... |
5086921f75c9341013a9bcda835037c2eeb451acee1086220e7c7382bdfcf955 | skanev/playground | 20.scm | SICP exercise 2.20
;
The procedures + , * and list take arbitrary number of arguments . One way to
; define such procedures is to use define with dotted-tail notation. In a
; procedure definition, a parameter list that has a dot before the last
; parameter name indicates that, when a procedure is called, the initia... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/20.scm | scheme |
define such procedures is to use define with dotted-tail notation. In a
procedure definition, a parameter list that has a dot before the last
parameter name indicates that, when a procedure is called, the initial
parameters (if any) will have as values the initial arguments, as usual, but
the final parameter's va... | SICP exercise 2.20
The procedures + , * and list take arbitrary number of arguments . One way to
the procedure f can be called with two or more arguments . If we evaluate
then in the body of f , x will be 1 , y will be 2 , and z will be the list ( 3 4 5 6 ) .
the procedure g can be called with zero or more ar... |
277e0d775f0b70923af441b84572dd9b3cb4a25707709592c062867ff8517beb | RolfRolles/PandemicML | IRRandomizedEvaluator.ml | open DataStructures
(* Evaluator functionality. This function is factored out so it can be used
elsewhere. *)
let write_mem memctx a32 v32 s =
let n = (IRUtil.bits s)/8 in
let rec aux v32 i =
if i = n
then ()
else
let addr = Int32.add a32 (Int32.of_int i) in
Hashtbl.replace memctx addr ... | null | https://raw.githubusercontent.com/RolfRolles/PandemicML/9c31ecaf9c782dbbeb6cf502bc2a6730316d681e/Projects/Nxcroticism/IRRandomizedEvaluator.ml | ocaml | Evaluator functionality. This function is factored out so it can be used
elsewhere.
Given:
ir: a list of IR statements. Not in SSA form, and no jumps.
regctx: (IR.var,IR.expr) Hashtbl.t, the register context
memctx: (int32,int32) Hashtbl.t, the memory context
Evaluate the statements in the give... | open DataStructures
let write_mem memctx a32 v32 s =
let n = (IRUtil.bits s)/8 in
let rec aux v32 i =
if i = n
then ()
else
let addr = Int32.add a32 (Int32.of_int i) in
Hashtbl.replace memctx addr (Int32.logand v32 0xffl);
aux (Int32.shift_right_logical v32 8) (i+1)
in aux v32 0
le... |
8d5a0d3e6cb2c50cd493ed2aef8a43517aaf864290fc30243da659c76e7ede5a | jeromesimeon/Galax | compile_context.ml | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/compile/compile_context.ml | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : compile_context.ml , v 1.28 2007/05/16 15:32:09 mff Exp $
open Namespace_util
open Namespace_names
open Norm_context
open Typing_context
open Xquery_algebra_ast
open Xquery_common_ast
open Error
type ('a,'b) compile_context =
... |
07c63b6a465c64eae687e1e82e997659fb793f215036bb5ddfb084efa229e1be | CryptoKami/cryptokami-core | Configuration.hs | {-# LANGUAGE Rank2Types #-}
module Pos.Infra.Configuration
( InfraConfiguration (..)
, HasInfraConfiguration
, infraConfiguration
, withInfraConfiguration
, ntpServers
) where
import Data.Aeson (FromJSON (..), genericParseJSON)
import Data.Reflection (Given... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/infra/Pos/Infra/Configuration.hs | haskell | # LANGUAGE Rank2Types #
------------------------------------------------------------------------
-- NTP slotting
------------------------------------------------------------------------
^ Broadcasting threshold
^ Number of nodes from batch for enhanced bessage broadcast
----------------------------------------------... | module Pos.Infra.Configuration
( InfraConfiguration (..)
, HasInfraConfiguration
, infraConfiguration
, withInfraConfiguration
, ntpServers
) where
import Data.Aeson (FromJSON (..), genericParseJSON)
import Data.Reflection (Given, give, given)
import ... |
8c23142fc777a7dce8d6125fee3d9f32e51ba8045d2c0bdadd4256c72d47dda5 | sids/nerchuko | test.clj | (ns nerchuko.examples.newsgroups.test
(:use nerchuko.examples.newsgroups.helpers)
(:use [nerchuko helpers classification])
(:use clojure.contrib.command-line))
(defn -main [& args]
(with-command-line (if (seq args) args ["--help"])
"Classify the files in the given directories and compare the
classification... | null | https://raw.githubusercontent.com/sids/nerchuko/8aa56497dd8e93e868713dd542667a56215522fb/src/nerchuko/examples/newsgroups/test.clj | clojure | (ns nerchuko.examples.newsgroups.test
(:use nerchuko.examples.newsgroups.helpers)
(:use [nerchuko helpers classification])
(:use clojure.contrib.command-line))
(defn -main [& args]
(with-command-line (if (seq args) args ["--help"])
"Classify the files in the given directories and compare the
classification... | |
c4cda8ee99200b0bdad94233554909804cd86551f8922d10440a6c44f1b68e58 | ku-fpg/hermit | Interpreter.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE KindSignatures #
{-# LANGUAGE GADTs #-}
# LANGUAGE InstanceSigs #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module HERMIT.Shell.Interpreter
( -- * The HERMIT Interpreter
Interp
, interp
, interpM
, interpEM
, interpExprH
, e... | null | https://raw.githubusercontent.com/ku-fpg/hermit/3e7be430fae74a9e3860b8b574f36efbf9648dec/src/HERMIT/Shell/Interpreter.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
* The HERMIT Interpreter
| An 'Interp' with no effects.
input: list length n, each elem is a variable length list of possible interpretations
output: variable length list, each elem is list of length n
ugly hack. The whole dynamic stuff could do with overhauling.
b... | # LANGUAGE KindSignatures #
# LANGUAGE InstanceSigs #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module HERMIT.Shell.Interpreter
Interp
, interp
, interpM
, interpEM
, interpExprH
, exprToDyns
) where
import Control.Monad (liftM, liftM2)
import Control.Monad.State (Mo... |
bebd984e5cccf1516dcd182c26e8749e16a46045edb6584af919abce52b2965f | CryptoKami/cryptokami-core | Script.hs | # LANGUAGE TemplateHaskell #
module Pos.Binary.Core.Script () where
import Universum
import Data.Hashable (Hashable, hashWithSalt)
import qualified PlutusCore.Program as PLCore
import qualified PlutusCore.Term as PLCore
import qualified PlutusTypes.ConSig as PLTypes
import qualified PlutusTypes.Ty... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/core/Pos/Binary/Core/Script.hs | haskell | # LANGUAGE TemplateHaskell #
module Pos.Binary.Core.Script () where
import Universum
import Data.Hashable (Hashable, hashWithSalt)
import qualified PlutusCore.Program as PLCore
import qualified PlutusCore.Term as PLCore
import qualified PlutusTypes.ConSig as PLTypes
import qualified PlutusTypes.Ty... | |
9b04a9b6a0d382ab8a0e03758b9f5d5af08ac689a7523217f369dbc6503380d7 | iu-parfunc/verified-instances | Sum.hs | {-@ LIQUID "--higherorder" @-}
{-@ LIQUID "--exactdc" @-}
{-@ LIQUID "--noadt" @-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module GenericProofs.VerifiedEq.Examples.Sum where
import Language.Haskell.Liquid.ProofCombinators
import GenericProofs.Iso
import GenericProofs.TH
i... | null | https://raw.githubusercontent.com/iu-parfunc/verified-instances/cebfdf1e3357a693360be74c90211be18ce3c045/generic-proofs/src/GenericProofs/VerifiedEq/Examples/Sum.hs | haskell | @ LIQUID "--higherorder" @
@ LIQUID "--exactdc" @
@ LIQUID "--noadt" @
@ axiomatize fromMySum @
@ axiomatize toMySum @
@ tofMySum :: a:MySum
-> { toMySum (fromMySum a) == a }
@
@ fotMySum :: a:RepMySum x
-> { fromMySum (toMySum a) == a }
@ | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module GenericProofs.VerifiedEq.Examples.Sum where
import Language.Haskell.Liquid.ProofCombinators
import GenericProofs.Iso
import GenericProofs.TH
import GenericProofs.VerifiedEq
import GenericProofs.VerifiedEq.Generics
import GenericProofs.VerifiedEq.Instances
... |
2275782fcceedc0ec05ae6fb7ab55ae9244198ae9eea89aa94781e6fa2877cd5 | DeepSec-prover/deepsec | process.ml | (**************************************************************************)
(* *)
DeepSec
(* *)
... | null | https://raw.githubusercontent.com/DeepSec-prover/deepsec/8ddc45ec79de5ec49810302ea7da32d3dc9f46e4/Source/core_library/process.ml | ocaml | ************************************************************************
... | DeepSec
, project PESTO ,
, project PESTO ,
, project PESTO ,
Copyright ( C ) INRIA 2017 - 2020
the GNU General Publ... |
e3426b92303f22f41bdb1c2fe72adc1abbf705871780715c8c45275b5039fd0d | toyokumo/tarayo | core.clj | (ns core
(:require
[criterium.core :as criterium]
[helper :as h]
[tarayo.core :as tarayo]))
(defn -main
[]
(h/with-test-smtp-server [_ port]
(println "TARAYO ----")
(criterium/bench
(with-open [conn (tarayo/connect {:port port})]
(tarayo/send! conn h/test-message)))))
| null | https://raw.githubusercontent.com/toyokumo/tarayo/f9b10b85b7bc1a188d808c3955e258916cd0b38a/benchmark/tarayo/core.clj | clojure | (ns core
(:require
[criterium.core :as criterium]
[helper :as h]
[tarayo.core :as tarayo]))
(defn -main
[]
(h/with-test-smtp-server [_ port]
(println "TARAYO ----")
(criterium/bench
(with-open [conn (tarayo/connect {:port port})]
(tarayo/send! conn h/test-message)))))
| |
87f44d7b8d0a927642e401a15af1fcc90b30d0ae92cf6e1d0311344337b817b3 | Eonblast/Scalaxis | yaws_api.erl | %%----------------------------------------------------------------------
%%% File : yaws_api.erl
Author : < >
%%% Purpose :
Created : 24 Jan 2002 by < >
%%%----------------------------------------------------------------------
-module(yaws_api).
-author('').
%% -compile(export_all).
-include("../incl... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/contrib/yaws/src/yaws_api.erl | erlang | ----------------------------------------------------------------------
File : yaws_api.erl
Purpose :
----------------------------------------------------------------------
-compile(export_all).
these are a bunch of function that are useful inside
yaws scripts
parse the command line query data
parse url encode... | Author : < >
Created : 24 Jan 2002 by < >
-module(yaws_api).
-author('').
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
-export([parse_query/1, parse_post/1,
parse_multipart_post/1, parse_multipart_post/2,
parse_multipart/2, parse_... |
7016b7f47a15603a35cd87b94576e0cbc0e4cd472a03bb8736d1b2c79d86e995 | tek/polysemy-http | UrlTest.hs | module Polysemy.Http.UrlTest where
import Exon (exon)
import Hedgehog ((===))
import Polysemy.Http.Data.Request (Host (Host), Path (Path), Port (Port), Tls (Tls))
import Polysemy.Http.Request (parseUrl)
import Polysemy.Http.Test (UnitTest)
test_url :: UnitTest
test_url = do
Right (Tls True, Host "host.com", Nothin... | null | https://raw.githubusercontent.com/tek/polysemy-http/92887b51c01add65dee03f30e3564e939ce4fbba/packages/polysemy-http/test/Polysemy/Http/UrlTest.hs | haskell | module Polysemy.Http.UrlTest where
import Exon (exon)
import Hedgehog ((===))
import Polysemy.Http.Data.Request (Host (Host), Path (Path), Port (Port), Tls (Tls))
import Polysemy.Http.Request (parseUrl)
import Polysemy.Http.Test (UnitTest)
test_url :: UnitTest
test_url = do
Right (Tls True, Host "host.com", Nothin... | |
15d433c449a53729b886a83a6005251b84d7a3ae82f7243df176111747b5adc4 | mransan/raft-udp | counter_pb.ml | [@@@ocaml.warning "-27-30-39"]
type app_data = {
increment : int;
process_id : int;
}
and app_data_mutable = {
mutable increment : int;
mutable process_id : int;
}
type app_result = {
from : int;
to_ : int option;
}
and app_result_mutable = {
mutable from : int;
mutable to_ : int option;
}
let rec ... | null | https://raw.githubusercontent.com/mransan/raft-udp/ffa307fa6d8bdaa3133f3cc66149ac7dfda5fc7c/tests/counter/counter_pb.ml | ocaml | [@@@ocaml.warning "-27-30-39"]
type app_data = {
increment : int;
process_id : int;
}
and app_data_mutable = {
mutable increment : int;
mutable process_id : int;
}
type app_result = {
from : int;
to_ : int option;
}
and app_result_mutable = {
mutable from : int;
mutable to_ : int option;
}
let rec ... | |
a0857925805f2361780bc56e84198bb0c643d5006fa4235e91d8771e3c273b8c | plumatic/grab-bag | core_test.clj | (ns kinesis.core-test
(:use plumbing.core plumbing.test clojure.test)
(:require
[plumbing.serialize :as serialize]
[kinesis.core :as kinesis]))
(deftest round-trip-test
(with-millis 100
(let [r (serialize/pack (kinesis/record-encoder) ["m1" {:m 2}])]
(is-= 1 (count r))
(is-= {:date 100 :mes... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/kinesis/test/kinesis/core_test.clj | clojure | (ns kinesis.core-test
(:use plumbing.core plumbing.test clojure.test)
(:require
[plumbing.serialize :as serialize]
[kinesis.core :as kinesis]))
(deftest round-trip-test
(with-millis 100
(let [r (serialize/pack (kinesis/record-encoder) ["m1" {:m 2}])]
(is-= 1 (count r))
(is-= {:date 100 :mes... | |
bcc32882338e56e4dd92497b67b5474192e1182e8519cd737db95edcb5866fb1 | mput/sicp-solutions | 2_41.rkt | #lang racket
Solution for exercise 2_41 .
(require rackunit "../solutions/2_40.rkt")
(provide sum-pairs)
(define (sum-pairs n s)
(map (lambda (x) (list (car x) (cadr x) (+ (car x) (cadr x))))
(filter (lambda (x) (= (+ (car x) (cadr x)) s))
(uniq-pairs n))))
| null | https://raw.githubusercontent.com/mput/sicp-solutions/fe12ad2b6f17c99978c8fe04b2495005986b8496/solutions/2_41.rkt | racket | #lang racket
Solution for exercise 2_41 .
(require rackunit "../solutions/2_40.rkt")
(provide sum-pairs)
(define (sum-pairs n s)
(map (lambda (x) (list (car x) (cadr x) (+ (car x) (cadr x))))
(filter (lambda (x) (= (+ (car x) (cadr x)) s))
(uniq-pairs n))))
| |
998a6f22dc716967d19d7a76f894a210d24341498932887f153350389848b77c | cedlemo/OCaml-GObject-Introspection | Test_property_info.ml |
* Copyright 2017 - 2019 ,
* This file is part of OCaml - GObject - Introspection .
*
* OCaml - GObject - Introspection is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GObject-Introspection/261c76d9e5d90f706edff1121a63bf5eb611399b/tests/Test_property_info.ml | ocaml |
* Copyright 2017 - 2019 ,
* This file is part of OCaml - GObject - Introspection .
*
* OCaml - GObject - Introspection is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 o... | |
befb573ee5b7ecbc375abfcba1bdd8d30c1722f9f5e78d6f233aace109fec255 | MaskRay/OJHaskell | AlternatingLane.hs | calc :: [Int] -> [Int] -> Double
calc low high = sum $ zipWith
(\(a,b) (c,d) ->
sum [
(let l = c; r = min i d
in if l <= r then (i-(l+r)/2.0)*(r-l+1)/(d-c+1)
else 0.0) -
(let r = d; l = max i c
in if l <= r then (i-(l+r)/2.0)*(r-l+1)/(d-c+1)
... | null | https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/TopCoder/SRM%20494/AlternatingLane.hs | haskell | calc :: [Int] -> [Int] -> Double
calc low high = sum $ zipWith
(\(a,b) (c,d) ->
sum [
(let l = c; r = min i d
in if l <= r then (i-(l+r)/2.0)*(r-l+1)/(d-c+1)
else 0.0) -
(let r = d; l = max i c
in if l <= r then (i-(l+r)/2.0)*(r-l+1)/(d-c+1)
... | |
8359accdd9a864418a960c47f63223e151d7e0c3fcc9db8e72cd52f238741525 | andrejbauer/coop | desugar.mli | (** The desugaring phase converts [Sugared] syntax to [Desugared] syntax. It
performs the following transformations.
The programmer may freely mix (effect-free) expressions and (effectful)
computations. The desugaring phase separtes them and hoists computations
which appear inside expressions into outer `l... | null | https://raw.githubusercontent.com/andrejbauer/coop/173d0889795c55a370f79fb42425b77a5c0c8464/src/desugar.mli | ocaml | * The desugaring phase converts [Sugared] syntax to [Desugared] syntax. It
performs the following transformations.
The programmer may freely mix (effect-free) expressions and (effectful)
computations. The desugaring phase separtes them and hoists computations
which appear inside expressions into outer `let... |
type desugar_error
* A desugaring context is a list of known identifiers , which is used to
compute indices .
compute de Bruijn indices. *)
type context
val initial : context
exception Error of desugar_error Location.located
val print_error : desugar_error -> Format.formatter -> unit
* Load a file and ... |
ec8943f57cb62bb1eda4af7abc1b1de4315e18fc2dfb6ba265f81c932055b949 | wdebeaum/DeepSemLex | tan.lisp | ;;;;
;;;; W::tan
;;;;
(define-words :pos w::adj :templ central-adj-templ
:words (
(W::tan
(SENSES
((meta-data :origin joust :entry-date 20091027 :change-date 20091027 :comments nil :wn ("tan%3:00:01:chromatic:00"))
(LF-PARENT ONT::tan)
(SYNTAX (W::morph (:forms (-er))))
(templ central-adj-te... | null | https://raw.githubusercontent.com/wdebeaum/DeepSemLex/ce0e7523dd2b1ebd42b9e88ffbcfdb0fd339aaee/trips/src/LexiconManager/Data/new/tan.lisp | lisp |
W::tan
|
(define-words :pos w::adj :templ central-adj-templ
:words (
(W::tan
(SENSES
((meta-data :origin joust :entry-date 20091027 :change-date 20091027 :comments nil :wn ("tan%3:00:01:chromatic:00"))
(LF-PARENT ONT::tan)
(SYNTAX (W::morph (:forms (-er))))
(templ central-adj-templ)
)
)
)... |
ccd9a3c816c43367428292d7d6645a95f45d66b01f76460392ffbecf94135e17 | stackbuilders/stache | Main.hs | # LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Main (main) where
import Data.Aeson (Value (..))
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.KeyMap as Aeson.KeyMap
import Data.List (foldl')
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import... | null | https://raw.githubusercontent.com/stackbuilders/stache/56dee2cd9a05926d916cb2873ca75dbb18da4f78/app/Main.hs | haskell | --------------------------------------------------------------------------
Command line options parsing
| Command line options.
| Context files.
| Where to save the result.
| Name of the template to render.
| Directories with templates.
--------------------------------------------------------------------------
H... | # LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Main (main) where
import Data.Aeson (Value (..))
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.KeyMap as Aeson.KeyMap
import Data.List (foldl')
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import... |
4867ba18824d08c9a6b8020e395b5d7d7d570981a1a9c212fa572ed09f23c275 | dym/movitz | partitions.lisp | $ I d : , v 1.1 2004/08/19 00:28:56 Exp $
(require :tmp/harddisk)
(provide :tmp/partitions)
(in-package muerte.x86-pc.harddisk)
(defstruct partition
bootable
start-cylinder
start-head
start-sector
type
end-cylinder
end-head
end-sector
start
size)
(defun read-partition-table (hdn &optional (... | null | https://raw.githubusercontent.com/dym/movitz/56176e1ebe3eabc15c768df92eca7df3c197cb3d/losp/tmp/partitions.lisp | lisp | $ I d : , v 1.1 2004/08/19 00:28:56 Exp $
(require :tmp/harddisk)
(provide :tmp/partitions)
(in-package muerte.x86-pc.harddisk)
(defstruct partition
bootable
start-cylinder
start-head
start-sector
type
end-cylinder
end-head
end-sector
start
size)
(defun read-partition-table (hdn &optional (... | |
6b362ae8f09368ebea071195ee445cec5a0f1ad6a6dbf3278096dbae228a0f5f | kaoskorobase/hsndfile | Internal.hs | # LANGUAGE ForeignFunctionInterface #
module Sound.File.Sndfile.Buffer.Internal
(
IOFunc
, hBufIO
, sf_readf_int16
, sf_writef_int16
, sf_readf_int32
, sf_writef_int32
, sf_readf_float
, sf_writef_float
, sf_readf_double
, sf_writef_double
) where
import Data.Int (Int16, Int32)
import Foreign.Ptr... | null | https://raw.githubusercontent.com/kaoskorobase/hsndfile/f532a1fdf119a543d7db20fe21f11ced5cffbb21/Sound/File/Sndfile/Buffer/Internal.hs | haskell | # LANGUAGE ForeignFunctionInterface #
module Sound.File.Sndfile.Buffer.Internal
(
IOFunc
, hBufIO
, sf_readf_int16
, sf_writef_int16
, sf_readf_int32
, sf_writef_int32
, sf_readf_float
, sf_writef_float
, sf_readf_double
, sf_writef_double
) where
import Data.Int (Int16, Int32)
import Foreign.Ptr... | |
2b3b0e4cb00c071eb14f35fbf1b980646992b558ded2e951b6646c9d6919615c | danieljharvey/mimsa | Primitives.hs | {-# LANGUAGE OverloadedStrings #-}
module Calc.Parser.Primitives
( primParser,
intParser,
)
where
import Calc.Parser.Shared
import Calc.Parser.Types
import Calc.Types.Expr
import Data.Functor (($>))
import Text.Megaparsec.Char
import qualified Text.Megaparsec.Char.Lexer as L
----
intParser :: Parser Int
int... | null | https://raw.githubusercontent.com/danieljharvey/mimsa/296ab9bcbdbaf682fa76921ce3c80d4bbafb52ae/llvm-calc/src/Calc/Parser/Primitives.hs | haskell | # LANGUAGE OverloadedStrings #
-- |
module Calc.Parser.Primitives
( primParser,
intParser,
)
where
import Calc.Parser.Shared
import Calc.Parser.Types
import Calc.Types.Expr
import Data.Functor (($>))
import Text.Megaparsec.Char
import qualified Text.Megaparsec.Char.Lexer as L
intParser :: Parser Int
intParser =
L.signed (string "" $> ()) L.... |
498998b05cfac0fe3e4f158edae15476e552a3846b0f4dcc7924f21583bd0c31 | agrafix/Spock | Routing.hs | # LANGUAGE DataKinds #
module Web.Spock.Routing where
import Control.Monad.Trans
import Data.HVect hiding (head)
import qualified Data.Text as T
import qualified Network.Wai as Wai
import Web.Routing.Combinators
import Web.Spock.Action
import Web.Spock.Internal.Wire (SpockMethod (..))
class RouteM t where
addMiddl... | null | https://raw.githubusercontent.com/agrafix/Spock/6055362b54f2fae5418188c3fc2fc1659ca43e79/Spock-core/src/Web/Spock/Routing.hs | haskell | # LANGUAGE DataKinds #
module Web.Spock.Routing where
import Control.Monad.Trans
import Data.HVect hiding (head)
import qualified Data.Text as T
import qualified Network.Wai as Wai
import Web.Routing.Combinators
import Web.Spock.Action
import Web.Spock.Internal.Wire (SpockMethod (..))
class RouteM t where
addMiddl... | |
7223eb1bd2a97ffbd50e78851132efd268fb0dd2c7d4281c79f1105bd9d5958f | iamFIREcracker/adventofcode | day19.lisp | (defpackage :aoc/2020/19 #.cl-user::*aoc-use*)
(in-package :aoc/2020/19)
(defun parse-sub-rule (string)
(if (find #\" string)
(list (string (char string 1)))
(mapcar #'parse-integer (cl-ppcre:split " " string))))
(defun parse-sub-rules (string)
(let ((sub-rules (cl-ppcre:split " \\| " string)))
(mapca... | null | https://raw.githubusercontent.com/iamFIREcracker/adventofcode/c395df5e15657f0b9be6ec555e68dc777b0eb7ab/src/2020/day19.lisp | lisp | too much recursion, give up!
termination rule, return it. | (defpackage :aoc/2020/19 #.cl-user::*aoc-use*)
(in-package :aoc/2020/19)
(defun parse-sub-rule (string)
(if (find #\" string)
(list (string (char string 1)))
(mapcar #'parse-integer (cl-ppcre:split " " string))))
(defun parse-sub-rules (string)
(let ((sub-rules (cl-ppcre:split " \\| " string)))
(mapca... |
83678a216c4f72ccecd918dae8838a5d16a0304d8d4de4e7e0e1b2993e309221 | malgo-lang/malgo | Unify.hs | # LANGUAGE CPP #
# LANGUAGE UndecidableInstances #
-- | Unification
module Malgo.Infer.Unify (Constraint (..), MonadBind (..), solve, generalize, generalizeMutRecs, instantiate) where
import Control.Lens (At (at), itraverse_, use, view, (%=), (?=))
import Data.HashMap.Strict qualified as HashMap
import Data.HashSet q... | null | https://raw.githubusercontent.com/malgo-lang/malgo/002f522bf6376edf67716cef99033d87b46112f4/src/Malgo/Infer/Unify.hs | haskell | | Unification
* Constraint
| Constraint
a :~ b means 'a ~ b'
| Monad that handles substitution over type variables
| Apply all substituation
| 'Right' (substituation, new constraints) or 'Left' (position, error message)
* Constraint solver
`toBound` "generates" a new bound variable from a free variable.
But i... | # LANGUAGE CPP #
# LANGUAGE UndecidableInstances #
module Malgo.Infer.Unify (Constraint (..), MonadBind (..), solve, generalize, generalizeMutRecs, instantiate) where
import Control.Lens (At (at), itraverse_, use, view, (%=), (?=))
import Data.HashMap.Strict qualified as HashMap
import Data.HashSet qualified as HashS... |
0830172fab01d4501cb6d1b074dae05cb16a2cfdc4e0f647dd708bbf877b68b9 | bennn/dissertation | base-types.rkt | #lang typed/racket
(define-type Color Symbol)
(require require-typed-check)
(require/typed/check "data.rkt"
[#:struct posn ([x : Real]
[y : Real])]
[#:struct block ([x : Real]
[y : Real]
[color : Color])]
[#:struct tetra ([center : posn]
... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/scrbl/jfp-2019/benchmarks/tetris/both/base-types.rkt | racket | #lang typed/racket
(define-type Color Symbol)
(require require-typed-check)
(require/typed/check "data.rkt"
[#:struct posn ([x : Real]
[y : Real])]
[#:struct block ([x : Real]
[y : Real]
[color : Color])]
[#:struct tetra ([center : posn]
... | |
07571ab3f34ec0622d827f1b75478249ce713929015bfbe80da25eaa025e174d | b-ryan/farmhand | config_test.clj | (ns farmhand.config-test
(:require [clojure.test :refer :all]
[farmhand.config :as cfg]))
(deftest test-redis-config
(is (= (with-redefs [cfg/all-env-vars (atom {"FARMHAND_REDIS_HOST" "abc"
"FARMHAND_REDIS_PORT" "123"
... | null | https://raw.githubusercontent.com/b-ryan/farmhand/b5c79124c710b69cce9d4a436228f9ae7e2cbb99/test/farmhand/config_test.clj | clojure | (ns farmhand.config-test
(:require [clojure.test :refer :all]
[farmhand.config :as cfg]))
(deftest test-redis-config
(is (= (with-redefs [cfg/all-env-vars (atom {"FARMHAND_REDIS_HOST" "abc"
"FARMHAND_REDIS_PORT" "123"
... | |
bd7462ad1d8ac77e4f49f5602d2ad6a26dbf0593618f60caad3f415517a36df3 | robert-strandh/Second-Climacs | define-modify-macro.lisp | (cl:in-package #:second-climacs-syntax-common-lisp)
(define-indentation-automaton compute-define-modify-macro-indentations
(tagbody
(next)
;; The current wad is the operator.
(maybe-assign-indentation 1 6)
(next)
;; The current wad ought to be the name.
(maybe-assign-indentation 6 4)
... | null | https://raw.githubusercontent.com/robert-strandh/Second-Climacs/b654fc1f3f0db73970db3074e1a7878e15a5e9f2/Code/Syntax/Common-Lisp/Indentation/define-modify-macro.lisp | lisp | The current wad is the operator.
The current wad ought to be the name.
The current wad ought to be the lambda list.
The current wad ought to be the function symbol.
Come here if the optional documentation is given | (cl:in-package #:second-climacs-syntax-common-lisp)
(define-indentation-automaton compute-define-modify-macro-indentations
(tagbody
(next)
(maybe-assign-indentation 1 6)
(next)
(maybe-assign-indentation 6 4)
(next)
(maybe-assign-indentation 4 2)
(compute-lambda-list-indentation cur... |
6cd6e9da96b489d2d24dd9004e161f511d9267561d028f71bb4521f7093bf4b4 | haskell-repa/repa | Elt.hs | | Values that can be stored in Arrays .
# LANGUAGE MagicHash , UnboxedTuples , TypeSynonymInstances , FlexibleInstances #
# LANGUAGE DefaultSignatures , FlexibleContexts , TypeOperators #
module Data.Array.Repa.Eval.Elt
(Elt (..))
where
import GHC.Prim
import GHC.Exts
import GHC.Types
import GHC.Word
import ... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa/Data/Array/Repa/Eval/Elt.hs | haskell | Note that the touch# function is special because we can pass it boxed or unboxed
values. The argument type has kind ?, not just * or #.
| Element types that can be used with the blockwise filling functions.
This class is mainly used to define the `touch` method. This is used internally
| Place a demand on a va... | | Values that can be stored in Arrays .
# LANGUAGE MagicHash , UnboxedTuples , TypeSynonymInstances , FlexibleInstances #
# LANGUAGE DefaultSignatures , FlexibleContexts , TypeOperators #
module Data.Array.Repa.Eval.Elt
(Elt (..))
where
import GHC.Prim
import GHC.Exts
import GHC.Types
import GHC.Word
import ... |
a23a83f5972e24bc43ace49dd3571ce9632a023663d517f3fa490e9d287cebeb | rhaberkorn/ermacs | edit_window.erl | -module(edit_window).
-include("edit.hrl").
-compile(export_all).
%%-export([Function/Arity, ...]).
%% NB: Height is the total height including modeline
make_window(Buffer, Y, Width, Height) ->
Id = make_ref(),
W = #window{start_mark={start, Id},
y=Y,
width=Width,
height=Height,
id=Id},
attach(W,... | null | https://raw.githubusercontent.com/rhaberkorn/ermacs/35c8f9b83ae85e25c646882be6ea6d340a88b05b/src/edit_window.erl | erlang | -export([Function/Arity, ...]).
NB: Height is the total height including modeline
Number of lines for viewing text - excludes modeline
"Attach" a window to a buffer. Puts a mark in the buffer so that
the window knows where it's up to. | -module(edit_window).
-include("edit.hrl").
-compile(export_all).
make_window(Buffer, Y, Width, Height) ->
Id = make_ref(),
W = #window{start_mark={start, Id},
y=Y,
width=Width,
height=Height,
id=Id},
attach(W, Buffer).
text_lines(W) when W#window.minibuffer == true ->
physical_lines(W);
tex... |
27856ada0758e0f2e9dfef5e2fed90279fce72cad636f037f030b1f51cdbc804 | dawidovsky/IIUWr | Szablon.rkt | #lang racket
;; expressions
(define (const? t)
(number? t))
(define (op? t)
(and (list? t)
(member (car t) '(+ - * /))))
(define (op-op e)
(car e))
(define (op-args e)
(cdr e))
(define (op-cons op args)
(cons op args))
(define (op->proc op)
(cond [(eq? op '+) +]
[(eq? op '*) *]
... | null | https://raw.githubusercontent.com/dawidovsky/IIUWr/73f0f65fb141f82a05dac2573f39f6fa48a81409/MP/Pracownia7/Szablon.rkt | racket | expressions
let-lifted expressions
generating a symbol using a counter
environments (could be useful for something)
the let-lift procedure | #lang racket
(define (const? t)
(number? t))
(define (op? t)
(and (list? t)
(member (car t) '(+ - * /))))
(define (op-op e)
(car e))
(define (op-args e)
(cdr e))
(define (op-cons op args)
(cons op args))
(define (op->proc op)
(cond [(eq? op '+) +]
[(eq? op '*) *]
[(eq? op '-) -... |
75ac686303d2f69b074259a67f66d2f3b0a634f350f1ba716cfab2924e1ceadf | coalton-lang/coalton | addressable.lisp | (coalton-library/utils:defstdlib-package #:coalton-library/addressable
(:use
#:coalton
#:coalton-library/classes)
(:export
#:Addressable #:eq? #:eq-hash))
(cl:in-package #:coalton-library/addressable)
this package mostly exists to reexport the ` Addressable ' class , and its method ` eq ? ' , which is d... | null | https://raw.githubusercontent.com/coalton-lang/coalton/d61804903f56c96094a0570a2fedc5eff65f211f/library/addressable.lisp | lisp | the instances we need to manually define, and to define functions which operate on `Addressable' instances. | (coalton-library/utils:defstdlib-package #:coalton-library/addressable
(:use
#:coalton
#:coalton-library/classes)
(:export
#:Addressable #:eq? #:eq-hash))
(cl:in-package #:coalton-library/addressable)
this package mostly exists to reexport the ` Addressable ' class , and its method ` eq ? ' , which is d... |
bb7357bdf940c3790f6e48989a4e0be4c1e6e46809c7ef18657bc72b169f8824 | v-kolesnikov/sicp | 1_02_test.clj | (ns sicp.chapter01.1-02-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-02 :refer :all]))
(deftest test-asserts
(assert-equal -37/150 solution))
| null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/test/sicp/chapter01/1_02_test.clj | clojure | (ns sicp.chapter01.1-02-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-02 :refer :all]))
(deftest test-asserts
(assert-equal -37/150 solution))
| |
a8727ce3a37dfe1d93241ce7459d357fddf1562c338eeb1b0e3372a6325fdc7b | Flexiana/xiana-template | core.clj | (ns {{sanitized-name}}.core
(:require
[{{sanitized-name}}.controllers.index :as index]
[{{sanitized-name}}.controllers.re-frame :as re-frame]
[{{sanitized-name}}.controllers.swagger :as swagger]
[xiana.config :as config]
[xiana.db :as db]
[xiana.interceptor :as interceptors]
[xiana.rbac :a... | null | https://raw.githubusercontent.com/Flexiana/xiana-template/6f42f39d179e8272fdac99248521a67d1a49e9f9/resources/leiningen/new/xiana/src/backend/app_name/core.clj | clojure | (ns {{sanitized-name}}.core
(:require
[{{sanitized-name}}.controllers.index :as index]
[{{sanitized-name}}.controllers.re-frame :as re-frame]
[{{sanitized-name}}.controllers.swagger :as swagger]
[xiana.config :as config]
[xiana.db :as db]
[xiana.interceptor :as interceptors]
[xiana.rbac :a... | |
970bcb88d10182ff339b44d709c8ca27545336075bcf13024c220b56415d2be0 | BinaryAnalysisPlatform/bap-plugins | expect.mli | * Given a sequence of expected strings [ E ] and test corpora [ S ] , we
want to ensure , that each expected string matches at least one
substring in a testing corpora , that is not matched by other
expected string .
This is a Maximum Bipartile Matching problem . First we find a MBP
solut... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap-plugins/2e9aa5c7c24ef494d0e7db1b43c5ceedcb4196a8/test-expect/expect.mli | ocaml | * [create regexp] takes a list of POSIX regular expressions
and converts it into an expectation
* [all_matches expectation data] checks that provided list of
strings [data] satisfies given [expectation]
* [pp_misses ppf misses] prints missed expectation into a given
formatter. | * Given a sequence of expected strings [ E ] and test corpora [ S ] , we
want to ensure , that each expected string matches at least one
substring in a testing corpora , that is not matched by other
expected string .
This is a Maximum Bipartile Matching problem . First we find a MBP
solut... |
d3cc27739d654007832156a7e151f2466c54efe48658c90f68bc6bcab3f7d3bc | mirage/ocaml-uri | gen_services.ml |
* Copyright ( c ) 2012 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | null | https://raw.githubusercontent.com/mirage/ocaml-uri/b4a8375d9352d29ff495d35fc309609fad74631a/config/gen_services.ml | ocaml |
* Copyright ( c ) 2012 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | |
6ed1f4e3165bc2b04cf77aad9cc321680fbe524f6f0322f546b78c1914d808f6 | sansarip/owlbear | user.cljs | (ns cljs.user
(:require [owlbear.parse :as obp]))
(defn load-wasms!
"Returns a promise encapsulating the loading of
all necessary WASM resources
Optionally accepts a collection of `wasms` e.g.
```clojure
[[:html \"path/to/html.wasm\"]]
```"
([] (load-wasms! [[obp/html-lang-id "resources/... | null | https://raw.githubusercontent.com/sansarip/owlbear/81c6c58e85b34079e6f5c6f45c49de16ab8823bc/dev/cljs/user.cljs | clojure | (ns cljs.user
(:require [owlbear.parse :as obp]))
(defn load-wasms!
"Returns a promise encapsulating the loading of
all necessary WASM resources
Optionally accepts a collection of `wasms` e.g.
```clojure
[[:html \"path/to/html.wasm\"]]
```"
([] (load-wasms! [[obp/html-lang-id "resources/... | |
d59e500ce3d575614b26ee9d9fb0adf0f29bd33a74b6f8d1e71d24c5d47d2bbd | oakes/play-clj-examples | desktop_launcher.clj | (ns breakout.core.desktop-launcher
(:require [breakout.core :refer :all])
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
[org.lwjgl.input Keyboard])
(:gen-class))
(defn -main
[]
(LwjglApplication. breakout "breakout" 800 600)
(Keyboard/enableRepeatEvents true))
| null | https://raw.githubusercontent.com/oakes/play-clj-examples/449a505a068faeeb35d4ee4622c6a05e3fff6763/breakout/desktop/src/breakout/core/desktop_launcher.clj | clojure | (ns breakout.core.desktop-launcher
(:require [breakout.core :refer :all])
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
[org.lwjgl.input Keyboard])
(:gen-class))
(defn -main
[]
(LwjglApplication. breakout "breakout" 800 600)
(Keyboard/enableRepeatEvents true))
| |
44bc506f8ab8e5d687ac91c7cc6b1ce7669106db900e5116088079144c1c0174 | gsakkas/rite | 20060324-20:45:28-232a876d350ebc97006824843fc62110.seminal.ml |
exception Unimplemented
exception AlreadyDone
(*** part a ***)
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
type move = Home | Forward of float | Turn of float | For of int*(move list)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060324-20%3A45%3A28-232a876d350ebc97006824843fc62110.seminal.ml | ocaml | ** part a **
** part b **
** part c **
** part d **
** part e **
** part f **
** possibly helpful testing code ** |
exception Unimplemented
exception AlreadyDone
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
type move = Home | Forward of float | Turn of float | For of int*(move list)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#... |
b2aa1ce4ba0be712ca03d73d611a36abf508e46c9009424920e2f3946ee58618 | functional-koans/clojure-koan-engine | koans.clj | (ns koan-engine.koans
(:use [clojure.java.io :only [file resource]])
(:require [koan-engine.util :as u]
[clojure.string :as str]))
;; TODO: Proper koan validation. Accept the path as an argument.
(defn ordered-koans [answer-path]
(map first (u/try-read (.getPath (resource answer-path)))))
(defn orde... | null | https://raw.githubusercontent.com/functional-koans/clojure-koan-engine/2ef0699a74a46978305ee116a193d2995038c21f/src/koan_engine/koans.clj | clojure | TODO: Proper koan validation. Accept the path as an argument. | (ns koan-engine.koans
(:use [clojure.java.io :only [file resource]])
(:require [koan-engine.util :as u]
[clojure.string :as str]))
(defn ordered-koans [answer-path]
(map first (u/try-read (.getPath (resource answer-path)))))
(defn ordered-koan-paths [koan-root answer-path]
(map (fn [koan-name]
... |
404762b05604196bab5dc94419335a50ef80ebcb3bf86408d53d2991701e6049 | smallhadroncollider/taskell | ParserTest.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
module Taskell.IO.Keyboard.ParserTest
( test_parser
) where
import ClassyPrelude
import Test.Tasty
import Test.Tasty.HUnit
import Data.FileEmbed (embedFile)
import Text.RawString.QQ (r)
import qualified Taskell.Events.Actions.Types as A
import ... | null | https://raw.githubusercontent.com/smallhadroncollider/taskell/944b713f55ecf47433890f740835021ea86fd995/test/Taskell/IO/Keyboard/ParserTest.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
module Taskell.IO.Keyboard.ParserTest
( test_parser
) where
import ClassyPrelude
import Test.Tasty
import Test.Tasty.HUnit
import Data.FileEmbed (embedFile)
import Text.RawString.QQ (r)
import qualified Taskell.Events.Actions.Types as A
import ... | |
f863a4945992ce4897589e5b1e06f3b0db2583c336b4396d78bc3a73c3aeac4d | dnlkrgr/hsreduce | MultiParams.hs | # language MultiParamTypeClasses #
# language FlexibleInstances #
module MultiParams where
class Arst a b where
inRelation :: a -> b -> Bool
instance Arst a a where
inRelation _ _ = True
instance Arst [ a ] ( Maybe a ) where
-- inRelation
| null | https://raw.githubusercontent.com/dnlkrgr/hsreduce/8f66fdee036f8639053067572b55d9a64359d22c/test-cases/regressions/MultiParams.hs | haskell | inRelation | # language MultiParamTypeClasses #
# language FlexibleInstances #
module MultiParams where
class Arst a b where
inRelation :: a -> b -> Bool
instance Arst a a where
inRelation _ _ = True
instance Arst [ a ] ( Maybe a ) where
|
ce1f61708583ea1e41609d55688309540f1fd114ee57f2d36548a69bc5d430b9 | Vaguery/klapaucius | inputs_test.clj | (ns push.interpreter.inputs-test
(:require [push.interpreter.templates.minimum :as m]
[push.util.stack-manipulation :as u])
(:use midje.sweet)
(:use [push.interpreter.core])
)
(fact "a bare naked Interpreter has an empty :bindings hashmap"
(:bindings (m/basic-interpreter)) => {})
(fact "`bin... | null | https://raw.githubusercontent.com/Vaguery/klapaucius/17b55eb76feaa520a85d4df93597cccffe6bdba4/test/push/interpreter/inputs_test.clj | clojure | bind-value
peek-at-binding
bind-inputs | (ns push.interpreter.inputs-test
(:require [push.interpreter.templates.minimum :as m]
[push.util.stack-manipulation :as u])
(:use midje.sweet)
(:use [push.interpreter.core])
)
(fact "a bare naked Interpreter has an empty :bindings hashmap"
(:bindings (m/basic-interpreter)) => {})
(fact "`bin... |
92578eb755de6fcedf91d971a3c82e27aa8db70cda866e2611f802486f2d3737 | softwarelanguageslab/maf | R5RS_WeiChenRompf2019_regex-derivative-3.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 1
* negated predicates : 1
* swapped branches : 1
* calls to i d fun : 2
(letrec ((debug-trace (lambda ()
'do-nothing))
(cadr (lambda (p)
(<change>
(car (cdr p))
((lambda ... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_WeiChenRompf2019_regex-derivative-3.scm | scheme | Changes: | * removed : 0
* added : 1
* swaps : 1
* negated predicates : 1
* swapped branches : 1
* calls to i d fun : 2
(letrec ((debug-trace (lambda ()
'do-nothing))
(cadr (lambda (p)
(<change>
(car (cdr p))
((lambda (x) x) (car... |
c538e24e50f8b952c7f2528227a7cf6413bc999a9b62dfec268753c044d19c5f | Bodigrim/poly | TestUtils.hs | # LANGUAGE CPP #
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE UndecidableInstances #-}
# OPTIONS_GHC -fno - warn -... | null | https://raw.githubusercontent.com/Bodigrim/poly/3c8e97fc6dbcab0ae0c7d6e3e569f2becc41dc9c/test/TestUtils.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE UndecidableInstances #
----------------------------------------------------------------------------- | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - orphans #
module TestUtils
( ShortPoly(..)
, tenTimesLess
, myNumLaws
#ifdef MIN... |
748c183100a5a099e0490782f81ff6583702a816ccafd177a6a69d6571d157fc | anmonteiro/aws-lambda-ocaml-runtime | request.ml | ----------------------------------------------------------------------------
* Copyright ( c ) 2019
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | null | https://raw.githubusercontent.com/anmonteiro/aws-lambda-ocaml-runtime/5d3210e0c6683f390cb5870efe7f774420ad4b22/vercel/request.ml | ocaml | ----------------------------------------------------------------------------
* Copyright ( c ) 2019
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | |
67f36ddfec491c1994707ec1e79cea43dc7ab5288ddf77373921976af6958bec | jfaure/Irie-lang | AdjointFoldsCH.hs | # Language FlexibleInstances , MultiParamTypeClasses , GADTs , RankNTypes , QuantifiedConstraints , PolyKinds , ImpredicativeTypes ,
module CH where
import Prelude hiding (Product , Sum)
import Data.Functor.Rep
import Data.Functor.Base
import Data.Functor.Sum
import Data.Functor.Product
import Control.Monad.Free
impo... | null | https://raw.githubusercontent.com/jfaure/Irie-lang/186640a095d14560ff102ef613648e558e5b3f1e/docs/AdjointFoldsCH.hs | haskell | <=> h = (id ||| id) . (A + h) . c
there is bijection between sets of hylos:
L_ (C , c) >-> (a,A) ~= (C,c) >-> _R (a,A)
thus: x = a . L (R x) . L c <=> y = R a . R (L y) . c
iff there is a bijection between the sets of arrows: (natural in both A and B)
adjunctL : C(L a -> b) ~= D(A -> R B) : adjunctR
= adjunctL i... | # Language FlexibleInstances , MultiParamTypeClasses , GADTs , RankNTypes , QuantifiedConstraints , PolyKinds , ImpredicativeTypes ,
module CH where
import Prelude hiding (Product , Sum)
import Data.Functor.Rep
import Data.Functor.Base
import Data.Functor.Sum
import Data.Functor.Product
import Control.Monad.Free
impo... |
c79d58185edbb6f595302f4032cac48fa822146cef02941324f83c2e568f6581 | patricoferris/ppx_deriving_graphql | ppx_deriving_graphql.ml | -----------------------------------------------------------------------------
Copyright ( c ) 2022 < >
Distributed under the MIT license . See terms at the end of this file .
-----------------------------------------------------------------------------
Copyright (c) 2022 Patrick Ferris <>
Distrib... | null | https://raw.githubusercontent.com/patricoferris/ppx_deriving_graphql/baebe154de846b06961b2661fe9311c95ca30d63/src/ppx_deriving_graphql.ml | ocaml | <><><> Attributes <><><>
<><><> Schemas <><><>
| [%type: char] -> [%expr fun (x : char) -> `String (String.make 1 x)]
<><><> Arguments <><><>
| [%type: char] -> [%expr fun (x : char) -> `String (String.make 1 x)] | -----------------------------------------------------------------------------
Copyright ( c ) 2022 < >
Distributed under the MIT license . See terms at the end of this file .
-----------------------------------------------------------------------------
Copyright (c) 2022 Patrick Ferris <>
Distrib... |
5b3cdeb905e2f2293211e8d5d4ac295a37458d469382bef937b1af0fe74a37d1 | froozen/kademlia | Networking.hs | |
Module : Network . Kademlia . Networking
Description : All of the UDP network code
Network . Kademlia . Networking implements all the UDP network functionality .
Module : Network.Kademlia.Networking
Description : All of the UDP network code
Network.Kademlia.Networking implements all the UDP netwo... | null | https://raw.githubusercontent.com/froozen/kademlia/60f05d0455b92960a1a51abd2932cd12d9e422db/src/Network/Kademlia/Networking.hs | haskell | KademliaHandle
Get addr to bind to
Create socket and bind to it
Return the handle
Get Peer's address
Send the signal
Close socket on exception (ThreadKilled)
| Dispatch the receiving process
fails, send it to the supplied default channel instead.
Read from socket
Try to create peer
Try parsing the sig... | |
Module : Network . Kademlia . Networking
Description : All of the UDP network code
Network . Kademlia . Networking implements all the UDP network functionality .
Module : Network.Kademlia.Networking
Description : All of the UDP network code
Network.Kademlia.Networking implements all the UDP netwo... |
b6bd75703a8ae1315c77803130695d641318b64c365a46f5207dbc24051a86b1 | dongcarl/guix | lint.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 < >
Copyright © 2014 , 2015 < >
Copyright © 2013 , 2014 , 2015 , 2016 , 2017 , 2018 , 2019 , 2020 < >
Copyright © 2015 , 2016 < >
Copyright © 2016 < dannym+ >
Copyright © 2016 < >
Copyright © 2017 < >
Copyright ©... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/guix/scripts/lint.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 < >
Copyright © 2014 , 2015 < >
Copyright © 2013 , 2014 , 2015 , 2016 , 2017 , 2018 , 2019 , 2020 < >
Copyright © 2015 , 2016 < >
Copyright © 2016 < dannym+ >
Copyright © 2016 < >
Copyright © 2017 < >
Copyright © 2017 < >
Copyright © 2017 , 2018 < >
Copyr... |
30ff845674fba4188f6873e5a21fd31d76909373a12332f2b56969c2feb0c576 | Eugleo/roguelike | generator.rkt | #lang racket
(provide village-generator%)
(require "rectangle.rkt" "tile.rkt")
(define generator
(interface () generate-tiles))
(define village-generator%
(class* object% (generator)
(super-new)
(init-field width height)
(define/public (generate-tiles width height)
(define rooms
... | null | https://raw.githubusercontent.com/Eugleo/roguelike/72c6988d9a9f184077f80a07cb6f8fddda9f7ec5/generator.rkt | racket | int (int, int) (int, int) -> (list rect)
Generate a given number of rooms of random size and position
int int terrain -> tile
Return the tile on the given coords
(matrix tile) -> int
Return the width of the map
(matrix tile) -> int
Return the height of the map | #lang racket
(provide village-generator%)
(require "rectangle.rkt" "tile.rkt")
(define generator
(interface () generate-tiles))
(define village-generator%
(class* object% (generator)
(super-new)
(init-field width height)
(define/public (generate-tiles width height)
(define rooms
... |
97802373861407c205ca07c4a2d3a2607cbde9f02ca349a2a2072bbb5c75d044 | TOTBWF/teenytt | TermBuilder.hs | | Helpers for constructing terms that involve Arithmetic .
module TeenyTT.Core.TermBuilder
( TB
, runTB
, var
, tpvar
-- * Term Builders
-- ** Pi Types
, pi
, lam
, ap
, aps
-- ** Sigma Types
, sigma
, pair
, fst
, snd
* *
, nat
, zero
, suc
-- ** Universes
, univ
, el
... | null | https://raw.githubusercontent.com/TOTBWF/teenytt/a45162254b4b3c056b1607f4759bd608fd355165/src/TeenyTT/Core/TermBuilder.hs | haskell | * Term Builders
** Pi Types
** Sigma Types
** Universes
| A Term Builder 'Env' keeps track of the /number/ of types
and terms that have been bound. This allows us to convert
------------------------------------------------------------------------------
Level Arithmetiic
------------------------------------------... | | Helpers for constructing terms that involve Arithmetic .
module TeenyTT.Core.TermBuilder
( TB
, runTB
, var
, tpvar
, pi
, lam
, ap
, aps
, sigma
, pair
, fst
, snd
* *
, nat
, zero
, suc
, univ
, el
) where
import Prelude hiding (pi, fst, snd)
import Control.Monad.Reader
... |
6d06805420bf3b5f813d83d7d1ece0086e2f2080a13eca874f8f99726eb01572 | metaocaml/ber-metaocaml | magic_number.ml | (* TEST
include config
binary_modules = "config build_path_prefix_map misc"
* bytecode
*)
open Misc
open Magic_number
(* sanity checking: the magic number at a given kind can be parsed back *)
let error kind test =
fatal_errorf
"Internal compiler error (%s): there is a magic number mismatch on kind %s"
test... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/utils/magic_number.ml | ocaml | TEST
include config
binary_modules = "config build_path_prefix_map misc"
* bytecode
sanity checking: the magic number at a given kind can be parsed back |
open Misc
open Magic_number
let error kind test =
fatal_errorf
"Internal compiler error (%s): there is a magic number mismatch on kind %s"
test
(string_of_kind kind)
let check_raw_kind kind =
let valid =
match parse_kind (raw_kind kind) with
| None -> false
| Some kind_roundtrip ->
... |
d56bbf2fd11f5c384669ef87257b828535680813015654ff803094ccf11d59bb | robrix/isometry | Framebuffer.hs | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
module GL.Framebuffer
( Framebuffer(..)
, Attachment(..)
, attachTexture
, Bind(..)
) where
import Control.Effect.Lift
import Control.Monad (unless)
import Data.Proxy
import GHC.Stack
import GL.Effect.Check
impor... | null | https://raw.githubusercontent.com/robrix/isometry/171b9261b8d7ea32c86ce6019c8c3973742f0349/src/GL/Framebuffer.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
module GL.Framebuffer
( Framebuffer(..)
, Attachment(..)
, attachTexture
, Bind(..)
) where
import Control.Effect.Lift
import Control.Monad (unless)
import Data.Proxy
import GHC.Stack
import GL.Effect.Check
impor... | |
662e25e977e08169dcef4eeaeaf8faaf043474f69f836d032a05bbbe7b74e054 | tmfg/mmtis-national-access-point | cloudwatch.clj | (ns dashboard.data.cloudwatch
(:require [amazonica.aws.cloudwatch :as cloudwatch]))
(defn last-five-minutes []
{:start-time (java.util.Date. (- (System/currentTimeMillis)
(* 1000 60 5)))
:end-time (java.util.Date.)
:period 300})
(defn fetch-metric
"Fetch last five minute... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/tools/dashboard/src/clj/dashboard/data/cloudwatch.clj | clojure | (ns dashboard.data.cloudwatch
(:require [amazonica.aws.cloudwatch :as cloudwatch]))
(defn last-five-minutes []
{:start-time (java.util.Date. (- (System/currentTimeMillis)
(* 1000 60 5)))
:end-time (java.util.Date.)
:period 300})
(defn fetch-metric
"Fetch last five minute... | |
25581c7016ccfb4ce67dbf997b1ba756c2138b6f4c7c3d7b8bbeb7ebddfd7b8f | racket/web-server | stateless.rkt | #lang web-server/base
(define-syntax-rule (require-provide mod ...)
(begin (require mod ...) (provide (all-from-out mod) ...)))
(require-provide "lib.rkt"
"input.rkt"
"syntax.rkt"
"dyn-syntax.rkt"
"embed.rkt")
(require racket/contract
web... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/formlets/stateless.rkt | racket | #lang web-server/base
(define-syntax-rule (require-provide mod ...)
(begin (require mod ...) (provide (all-from-out mod) ...)))
(require-provide "lib.rkt"
"input.rkt"
"syntax.rkt"
"dyn-syntax.rkt"
"embed.rkt")
(require racket/contract
web... | |
b22cfee81e39ab40cfa033cffc427f4d36843fc0a92671035cf15e768b9d8dba | pveber/bistro | idr.mli | open Bistro
open Formats
type 'a format
val narrowPeak : Macs2.narrow_peaks format
val broadPeak : Macs2.broad_peaks format
val bed : bed3 format
val gff : gff format
type 'a output = [`idr_output of 'a]
val idr :
input_file_type:'a format ->
?idr_threshold:float ->
?soft_idr_threshold:float ->
?peak_merge_... | null | https://raw.githubusercontent.com/pveber/bistro/da0ebc969c8c5ca091905366875cbf8366622280/lib/bio/idr.mli | ocaml | open Bistro
open Formats
type 'a format
val narrowPeak : Macs2.narrow_peaks format
val broadPeak : Macs2.broad_peaks format
val bed : bed3 format
val gff : gff format
type 'a output = [`idr_output of 'a]
val idr :
input_file_type:'a format ->
?idr_threshold:float ->
?soft_idr_threshold:float ->
?peak_merge_... | |
82cb936b5575fbbd03c57108a76c60b1c2db4d454d2b6339e446efa2228ed65a | duncanatt/detecter | analyzer.erl | %%% ----------------------------------------------------------------------------
@author
%%%
%%% @doc Module description (becomes module heading).
%%%
%%% @end
%%%
Copyright ( c ) 2021 , < >
%%%
%%% This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General... | null | https://raw.githubusercontent.com/duncanatt/detecter/7070ddd6b16dd323a81077a2915f4b938f9f0b80/detecter/src/monitoring/analyzer.erl | erlang | ----------------------------------------------------------------------------
@doc Module description (becomes module heading).
@end
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
FITNES... | @author
Copyright ( c ) 2021 , < >
under the terms of the GNU General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option )
ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or
You should have received a copy of the GNU... |
fc6d0b3bd452d52c8d4a7762276df04b292fae94df8dda636169657f98e31714 | ghc/ghc | Ppr.hs |
| Provides facilities for pretty - printing ' Nabla 's in a way appropriate for
-- user facing pattern match warnings.
module GHC.HsToCore.Pmc.Ppr (
pprUncovered
) where
import GHC.Prelude
import GHC.Data.List.Infinite (Infinite (..))
import qualified GHC.Data.List.Infinite as Inf
import GHC.Types.Basi... | null | https://raw.githubusercontent.com/ghc/ghc/37cfe3c0f4fb16189bbe3bb735f758cd6e3d9157/compiler/GHC/HsToCore/Pmc/Ppr.hs | haskell | user facing pattern match warnings.
| Pretty-print the guts of an uncovered value vector abstraction, i.e., its
components and refutable shapes associated to any mentioned variables.
@
(Just p) q
@
additional elements are indicated by "...".
there are no refutations
No outer parentheses when it's a unary pa... |
| Provides facilities for pretty - printing ' Nabla 's in a way appropriate for
module GHC.HsToCore.Pmc.Ppr (
pprUncovered
) where
import GHC.Prelude
import GHC.Data.List.Infinite (Infinite (..))
import qualified GHC.Data.List.Infinite as Inf
import GHC.Types.Basic
import GHC.Types.Id
import GHC.Types.... |
b575ea583ad40bae1670ba9a74a7a2ea7a9a6998b9ea8046a961bdce4f5c01bb | exercism/erlang | example.erl | -module(example).
-export([score/2]).
score(X, Y) when X*X+Y*Y=<1 -> 10;
score(X, Y) when X*X+Y*Y=<25 -> 5;
score(X, Y) when X*X+Y*Y=<100 -> 1;
score(_, _) -> 0.
| null | https://raw.githubusercontent.com/exercism/erlang/57ac2707dae643682950715e74eb271f732e2100/exercises/practice/darts/.meta/example.erl | erlang | -module(example).
-export([score/2]).
score(X, Y) when X*X+Y*Y=<1 -> 10;
score(X, Y) when X*X+Y*Y=<25 -> 5;
score(X, Y) when X*X+Y*Y=<100 -> 1;
score(_, _) -> 0.
| |
129b6ed0af25fadc196a5df16c5713355992ce1e644021a0f57fc4945ea8c9b0 | armedbear/abcl | test-cffi.lisp | (require :asdf)
(require :abcl-contrib)
(asdf:make :abcl-asdf)
(asdf:make :jna)
(ql:quickload
'(:cffi :cffi-tests))
(time
(asdf:test-system :cffi))
| null | https://raw.githubusercontent.com/armedbear/abcl/dad0efca42e4b90b042e415bd188ea86cba4145e/ci/test-cffi.lisp | lisp | (require :asdf)
(require :abcl-contrib)
(asdf:make :abcl-asdf)
(asdf:make :jna)
(ql:quickload
'(:cffi :cffi-tests))
(time
(asdf:test-system :cffi))
| |
257defdabeae13bf675bb7b09c125d3ac4b51250b42b2a18b9ffbcc4551ec52c | rayiner/amd64-asm | encoders.lisp | ; encoders.lisp
; Encoders for AMD64 instruction set.
(in-package "AMD64-ASM")
; maybe move condition definitions somewhere else
(define-condition assembler-error (error)
(()))
(define-condition encoding-error (assembler-error)
((form :initarg :form :reader encoding-error-form)))
(define-condition assertion-fai... | null | https://raw.githubusercontent.com/rayiner/amd64-asm/27ac3e683557d691cd68472c94d110f32334f61a/encoders.lisp | lisp | encoders.lisp
Encoders for AMD64 instruction set.
maybe move condition definitions somewhere else
make this more sophisticated for error handling later
info about operands of an instruction
info about the opcodes of an instruction
Syntax for defining instruction encoders.
Encoder consists of sequences of clause... |
(in-package "AMD64-ASM")
(define-condition assembler-error (error)
(()))
(define-condition encoding-error (assembler-error)
((form :initarg :form :reader encoding-error-form)))
(define-condition assertion-failed (encoding-error)
((check :initarg :check :reader assertion-failed-check)))
(defmacro with-checks ... |
44f992819988a592d4e05bd424cd7a2446e6128384db84804adefb5618682f6e | racket/racket7 | class.rkt | #lang racket/base
(require "chyte.rkt"
"chyte-case.rkt"
"../common/range.rkt")
(provide parse-class
parse-posix-char-class)
;; returns (values success? range pos)
(define (parse-class s pos config)
We know there 's at least one character
(define (success v) (values #t v (add1 pos)))
(... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/regexp/parse/class.rkt | racket | returns (values success? range pos)
----------------------------------------
Returns (values success? range position) | #lang racket/base
(require "chyte.rkt"
"chyte-case.rkt"
"../common/range.rkt")
(provide parse-class
parse-posix-char-class)
(define (parse-class s pos config)
We know there 's at least one character
(define (success v) (values #t v (add1 pos)))
(chyte-case
(chytes-ref s pos)
[(#... |
ac30292953e45fc6a247bd6a4fa037369d8548cba8c91b5743ae1a09c64dff7e | tezos/tezos-mirror | RPC_server.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 - 2023 Trili Tech < >
Copyright ( c... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/bbca5502eb430d3915ad697259d3bffc62c2d01d/src/lib_dac_node/RPC_server.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 - 2023 Trili Tech < >
Copyright ( c ) 2022 Nomadic Labs < >
Copyright ( c ) 2023 Marigold < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons... |
7b013a62f28f75fe75232130a2a27763c1b40b8284cc72030b62fd91bcb19f77 | ndmitchell/extra | Extra.hs | module Data.Foldable.Extra
( module Data.Foldable
, notNull
, sum'
, product'
, sumOn'
, productOn'
, anyM
, allM
, orM
, andM
, findM
, firstJustM
) where
import Data.Foldable
import qualified Control.Monad.Extra as MX
-- | Composition of 'not' and 'null'
notNull :... | null | https://raw.githubusercontent.com/ndmitchell/extra/207894522b3a9261bca021db9c91b514c0d0667c/src/Data/Foldable/Extra.hs | haskell | | Composition of 'not' and 'null'
| A generalization of 'Data.List.Extra.product'' to 'Foldable' instances.
| A generalization of 'Data.List.Extra.sumOn'' to 'Foldable' instances. | module Data.Foldable.Extra
( module Data.Foldable
, notNull
, sum'
, product'
, sumOn'
, productOn'
, anyM
, allM
, orM
, andM
, findM
, firstJustM
) where
import Data.Foldable
import qualified Control.Monad.Extra as MX
notNull :: Foldable f => f a -> Bool
notNull =... |
3f8df23117699850ad456b9d6b830ae9462c649acd7a71a93acd0745285e1f9c | revnull/fixfile | TestBTree.hs | # LANGUAGE DataKinds #
module TestBTree(testBTree) where
import Data.Function
import Data.List hiding (null)
import Data.Monoid
import Prelude hiding (null)
import Test.Tasty
import Test.Tasty.QuickCheck
import Test.QuickCheck
import Data.FixFile
import Data.FixFile.BTree
import qualified Data.FixFile.Tree23 as T23... | null | https://raw.githubusercontent.com/revnull/fixfile/888945268c04a1cb2636e85e7368c0e8d36b8033/tests/TestBTree.hs | haskell | # LANGUAGE DataKinds #
module TestBTree(testBTree) where
import Data.Function
import Data.List hiding (null)
import Data.Monoid
import Prelude hiding (null)
import Test.Tasty
import Test.Tasty.QuickCheck
import Test.QuickCheck
import Data.FixFile
import Data.FixFile.BTree
import qualified Data.FixFile.Tree23 as T23... | |
03aaef6a235f867885da88e5847039c10e9732396ebe1269632381b972edf1dd | facebook/duckling | Corpus.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Ordinal.EL.Corpus
( corpus ) where
import Data.String... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Ordinal/EL/Corpus.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Ordinal.EL.Corpus
( corpus ) where
import Data.String
import Prelude
import Duckling.Locale
import Duckling.Ordinal.Types
import Duckling.Resolve
import Duckling.Testing.Types
corpus :: Corpus
corpus = (testContext {locale = makeLocale EL Nothin... |
a40e4a5c4bc893ac095fa89e49ae19ca59bc04833ca70017ecb00cdcc7b6db68 | jdsandifer/AutoLISP | CONTRAILCOUNTDIALOG.lsp | ;;;;;;;[ Continuous Rail Count Dialog ];;;;;;;;;
;; ;;
;; Function for counting rails with long ;;
;; center lines. Uses a dialog box to select ;;
the layer for the lines . ; ;
;; ;;
;;:::::::::::::::... | null | https://raw.githubusercontent.com/jdsandifer/AutoLISP/054c8400fae84c223c3113e049a1ab87d374ba37/Old/CONTRAILCOUNTDIALOG.lsp | lisp | [ Continuous Rail Count Dialog ];;;;;;;;;
;;
Function for counting rails with long ;;
center lines. Uses a dialog box to select ;;
;
;;
::::::::::::::::::::::::::::::::::::::::::::::;;
... |
JD : ClearHash - Copyright 2016
(defun C:ContRailCountDialog ( / )
(princ "Hi there!")
(princ))
(princ) |
91ed5d6aa834eb2d07cc5ab4b16ad764e8a52210977f5b31818ca60d19295836 | buildsome/buildsome | Printer.hs | # LANGUAGE FlexibleInstances , RecordWildCards , GeneralizedNewtypeDeriving #
module Lib.Printer
( Id(..)
, Printable
, Printer, new, newFrom, render
, printStrLn, rawPrintStrLn
, printWrap
, ColorScheme(..)
, rawPrintWrap, rawPrinterWrap
) where
import Data.ByteString (ByteString)
import qua... | null | https://raw.githubusercontent.com/buildsome/buildsome/479b92bb74a474a5f0c3292b79202cc850bd8653/src/Lib/Printer.hs | haskell | # INLINE new # | # LANGUAGE FlexibleInstances , RecordWildCards , GeneralizedNewtypeDeriving #
module Lib.Printer
( Id(..)
, Printable
, Printer, new, newFrom, render
, printStrLn, rawPrintStrLn
, printWrap
, ColorScheme(..)
, rawPrintWrap, rawPrinterWrap
) where
import Data.ByteString (ByteString)
import qua... |
c611e87e1a296de0b2fbd4dbfda22401d8d8f85677c779a3904032a652517789 | cblp/crdt | PNCounter.hs | # LANGUAGE NamedFieldPuns #
module CRDT.Cv.PNCounter
( PNCounter (..)
, initial
, query
-- * Operations
, decrement
, increment
) where
import Data.Semilattice (Semilattice)
import CRDT.Cv.GCounter (GCounter)
import qualified CRDT.Cv.GCounter as GCounter
|
Positiv... | null | https://raw.githubusercontent.com/cblp/crdt/175d7ee7df66de1f013ee167ac31719752e0c20b/crdt/lib/CRDT/Cv/PNCounter.hs | haskell | * Operations
| Get value from the state
| Decrement counter
^ replica id
| Increment counter
^ replica id
| Initial state | # LANGUAGE NamedFieldPuns #
module CRDT.Cv.PNCounter
( PNCounter (..)
, initial
, query
, decrement
, increment
) where
import Data.Semilattice (Semilattice)
import CRDT.Cv.GCounter (GCounter)
import qualified CRDT.Cv.GCounter as GCounter
|
Positive - negative counter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.