_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 |
|---|---|---|---|---|---|---|---|---|
2cd90c29a2cc19996fee479786179561dae1409d0f6203821879188b0af6f6b8 | zk/clojuredocs | server.clj | (ns clojuredocs.api.server
(:require [compojure.core :refer (defroutes GET POST PUT DELETE ANY PATCH) :as cc]
[compojure.route :refer (not-found)]
[somnium.congomongo :as mon]
[clout.core :as clout]
[slingshot.slingshot :refer [try+ throw+]]
[clojuredocs.uti... | null | https://raw.githubusercontent.com/zk/clojuredocs/28f5ee500f4349039ee81c70d7ac40acbb19e5d8/src/clj/clojuredocs/api/server.clj | clojure | (ns clojuredocs.api.server
(:require [compojure.core :refer (defroutes GET POST PUT DELETE ANY PATCH) :as cc]
[compojure.route :refer (not-found)]
[somnium.congomongo :as mon]
[clout.core :as clout]
[slingshot.slingshot :refer [try+ throw+]]
[clojuredocs.uti... | |
6f03d00f2ce2072421e411596561dbc86ad6d8ec4b3c8599ace5c300d8d41376 | msakai/ptq | PDict.hs | -----------------------------------------------------------------------------
-- |
-- Module : PDict
Copyright : ( c ) 2007 - 2009
-- License : BSD3-style (see LICENSE)
--
-- Maintainer:
-- Stability : experimental
-- Portability : portable
module PDict where
import P
-------------------... | null | https://raw.githubusercontent.com/msakai/ptq/bd40c7ba90da5bf439626db00925707b5cff6d74/src/PDict.hs | haskell | ---------------------------------------------------------------------------
|
Module : PDict
License : BSD3-style (see LICENSE)
Maintainer:
Stability : experimental
Portability : portable
--------------------------------------------------------------------------- | Copyright : ( c ) 2007 - 2009
module PDict where
import P
john, mary, bill, ninety :: P T
john = B cat_T "john"
mary = B cat_T "mary"
bill = B cat_T "bill"
ninety = B cat_T "ninety"
run, walk, talk, rise, change :: P IV
run = B cat_IV "run"
walk = B cat_IV "walk"
talk = B cat_IV "talk"
rise ... |
11864e9c6b67bebe81bef2494ee5a6755d25bfb42a7c78852d5f3f3586db51b3 | jyh/metaprl | mfir_connect_base.ml |
* Basic operations for converting between the MCC FIR and
* MetaPRL terms .
*
* ----------------------------------------------------------------
*
* @begin[license ]
* This file is part of MetaPRL , a modular , higher order
* logical framework that provides a logical programming
* environment... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/fir/mfir_connect_base.ml | ocaml | *************************************************************************
* Print out the given term, and then raise a RefineError.
* func_name is a string that should be the name of the function
* raising the error.
*************************************************************************
* BUG: We want... |
* Basic operations for converting between the MCC FIR and
* MetaPRL terms .
*
* ----------------------------------------------------------------
*
* @begin[license ]
* This file is part of MetaPRL , a modular , higher order
* logical framework that provides a logical programming
* environment... |
c126eb39d0c6500ce8b279680c86eddd3f55c438d8331bcc331ff263a5fb4fab | mrkkrp/lame | Internal.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE RecordWildCards #
-- |
-- Module : Codec.Audio.LAME.Internal
Copyright : © 2017 – present
License : BSD 3 clause
--
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
-- Low-level ... | null | https://raw.githubusercontent.com/mrkkrp/lame/7aa4a69015340507c479cead9bd0e4e91859c66f/Codec/Audio/LAME/Internal.hs | haskell | |
Module : Codec.Audio.LAME.Internal
Stability : experimental
Portability : portable
Low-level non-public helpers.
* Types
* Low-level API
** Input stream description
** General control parameters
** Frame parameters
** Filtering control
* Tags
* Encoding
---------------------------------------... | # LANGUAGE FlexibleContexts #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE RecordWildCards #
Copyright : © 2017 – present
License : BSD 3 clause
Maintainer : < >
module Codec.Audio.LAME.Internal
Lame,
VbrMode (..),
LameException (..),
withLame,
initParams,
setNu... |
f9e08b0653e78a21e98af0ccf11d9433d7d2112f1efd0e1e8b094dc658ccc24b | SimulaVR/godot-haskell | RectangleShape2D.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.RectangleShape2D
(Godot.Core.RectangleShape2D.get_ex... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/RectangleShape2D.hs | haskell | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.RectangleShape2D
(Godot.Core.RectangleShape2D.get_ex... | |
4794f1150905ba842f130d4d53f0cd7b4fd827064128e073c69d8a2f46555285 | EligiusSantori/L2Apf | select_server.scm | (module logic racket/base
(require
racket/contract
racket/tcp
(relative-in "../."
"library/extension.scm"
"system/structure.scm"
"system/crypter.scm"
"system/connection.scm"
(only-in "packet/packet.scm" get-packet-id)
"packet/login/client/select_server.scm"
"packet/login/server/play_fail.scm... | null | https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/api/select_server.scm | scheme | Login-server interaction.
Game-server interaction. | (module logic racket/base
(require
racket/contract
racket/tcp
(relative-in "../."
"library/extension.scm"
"system/structure.scm"
"system/crypter.scm"
"system/connection.scm"
(only-in "packet/packet.scm" get-packet-id)
"packet/login/client/select_server.scm"
"packet/login/server/play_fail.scm... |
1abcf44f89de1211a753e9e909846c8ae4df1c2174049637764014b299173ac1 | swlkr/majestic-web | logic_test.clj | (ns {{name}}.users.logic-test
(:require [clojure.test :refer :all]
[{{name}}.users.logic :as users.logic]
[{{name}}.users.db :as users.db]
[{{name}}.utils :as utils]))
(deftest create!-test
(testing "with valid params"
(let [params {:id (utils/uuid) :email "" :password "pass... | null | https://raw.githubusercontent.com/swlkr/majestic-web/3d247f6b5ccc4ff3662a64544a4ca27beada971b/resources/leiningen/new/majestic_web/test/users/logic_test.clj | clojure | (ns {{name}}.users.logic-test
(:require [clojure.test :refer :all]
[{{name}}.users.logic :as users.logic]
[{{name}}.users.db :as users.db]
[{{name}}.utils :as utils]))
(deftest create!-test
(testing "with valid params"
(let [params {:id (utils/uuid) :email "" :password "pass... | |
b6ca1cb5c7fc389f793f03624b3e717f01301dae44252df8171e185d865cb7a5 | soulomoon/SICP | Exercise5.30.scm | ;
Exercise 5.30 : Our evaluator currently catches and signals only two kinds of errors — unknown expression types and unknown procedure types . Other errors will take us out of the evaluator read - eval - print loop . When we run the evaluator using the register - machine simulator , these errors are caught by the unde... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter5/Exercise5.30.scm | scheme |
Errors that occur in the evaluation process, such as an attempt to access an unbound variable, could be caught by changing the lookup operation to make it return a distinguished condition code, which cannot be a possible value of any user variable. The evaluator can test for this condition code and then do what is ne... | Exercise 5.30 : Our evaluator currently catches and signals only two kinds of errors — unknown expression types and unknown procedure types . Other errors will take us out of the evaluator read - eval - print loop . When we run the evaluator using the register - machine simulator , these errors are caught by the underl... |
396f7b6a6ee4abecfdce1c63b55f360bb5ac228dce0a4ea2ae1691b162947ac0 | hgoes/vvt | ProgramInfo.hs | # LANGUAGE ViewPatterns , ScopedTypeVariables #
module Realization.Threaded.ProgramInfo where
import Realization.Threaded.ThreadFinder
import Realization.Threaded.Slicing (getSlicing)
import LLVM.FFI
import Foreign.Ptr (Ptr)
import Data.Map (Map)
import qualified Data.Map as Map
import Text.Show
import System.IO.Unsa... | null | https://raw.githubusercontent.com/hgoes/vvt/dd2809753d7e5059d9103ea578f36afa8294cd84/Realization/Threaded/ProgramInfo.hs | haskell | # LANGUAGE ViewPatterns , ScopedTypeVariables #
module Realization.Threaded.ProgramInfo where
import Realization.Threaded.ThreadFinder
import Realization.Threaded.Slicing (getSlicing)
import LLVM.FFI
import Foreign.Ptr (Ptr)
import Data.Map (Map)
import qualified Data.Map as Map
import Text.Show
import System.IO.Unsa... | |
5b69e07eac99bf2fee7952c8a4b26912b2aa94b875e2c1161adce186570db8fa | rixed/ramen | RamenGlobalVariables.ml | Compile time global variables representation .
*
* Note on usage :
*
* - We use a single environment with one DB per global variable ( as opposed
* to , say , one environment per global variable ) , so that different
* read / write accesses to different global variables happening in a single ... | null | https://raw.githubusercontent.com/rixed/ramen/32782349d300c7b3c06f5b3cc942c762323fc3e2/src/RamenGlobalVariables.ml | ocaml | Compile time global variables representation .
*
* Note on usage :
*
* - We use a single environment with one DB per global variable ( as opposed
* to , say , one environment per global variable ) , so that different
* read / write accesses to different global variables happening in a single ... | |
09f96786a3c4c3ac1768f0001f7b37fe41a2df1b4a64b974dfc83c966f6a06eb | charlieg/Sparser | earnings-report.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1995 - 1998 -- all rights reserved
;;;
;;; File: "earnings report"
;;; Module: "model;sl:ERN:"
Version : 1.0 July 1998
initiated 12/20/95 . Elaborated through 1/8/96
1.0 ( 7/12/98 ) Started to rework the files into th... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/model/sl/ERN/earnings-report.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "earnings report"
Module: "model;sl:ERN:"
--------------------------------------------------------------------
a toplevel stub to provide a hook for the individual autodef items
-------------------------------------------------------------------... | copyright ( c ) 1995 - 1998 -- all rights reserved
Version : 1.0 July 1998
initiated 12/20/95 . Elaborated through 1/8/96
1.0 ( 7/12/98 ) Started to rework the files into the new era of lattice - points .
(in-package :sparser)
(define-category company-financials
:specializes nil )
(define-autod... |
ae27ac8b865bd6081972ff501e04077a67bd372bf916aca5b8002885933ec0e9 | scrintal/heroicons-reagent | server_stack.cljs | (ns com.scrintal.heroicons.solid.server-stack)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M5.507 4.048A3 3 0 017.785 3h8.43a3 3 0 012.278 1.048l1.722 2.008A4.533 4.533 0 0019.5 6h-15c-.243 0-.482.02-.715.0... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/server_stack.cljs | clojure | (ns com.scrintal.heroicons.solid.server-stack)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M5.507 4.048A3 3 0 017.785 3h8.43a3 3 0 012.278 1.048l1.722 2.008A4.533 4.533 0 0019.5 6h-15c-.243 0-.482.02-.715.0... | |
93caf217c63364419fce536e733d199668b59ed60768cc2f26a151d46e22b416 | smtcoq/smtcoq | coqInterface.ml | (**************************************************************************)
(* *)
(* SMTCoq *)
Copyright ( C ) 2011 - 2022
(* ... | null | https://raw.githubusercontent.com/smtcoq/smtcoq/c0a1b83a76f9cf204de434eca969948c89c44598/src/trace/coqInterface.ml | ocaml | ************************************************************************
SMTCoq
... | Copyright ( C ) 2011 - 2022
See file " " for the list of authors
Constr generation and manipulation
type id = Names.variable
let mkId = Names.Id.of_string
type name = Names.Name.t
let name_of_id i = Names.Name i
let mkName s =
let i... |
2fdc22ffcb75751182265e03ea712795a5a54939ace96f11f52fc381c96ac9e5 | ghc/nofib | ThmTactics.hs | module ThmTactics where
import Lookup
import Tactics
import Tacticals
import Kernel
import Tree
import Core_datatype
import DerivedRules
import Goals
import Vtslib
import Type_defs
import Parse
import X_interface
import Edlib
import Globals
import Tags -- partain
import Sub_Core1
import Sub_Core2
im... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/real/veritas/ThmTactics.hs | haskell | partain
nprimes i = take i ( repeat '\39' )
(******************************************************************************)
(* complete_thm *)
(* *)
(* ô ... | module ThmTactics where
import Lookup
import Tactics
import Tacticals
import Kernel
import Tree
import Core_datatype
import DerivedRules
import Goals
import Vtslib
import Type_defs
import Parse
import X_interface
import Edlib
import Globals
import Sub_Core1
import Sub_Core2
import Sub_Core3
import S... |
5114aef427b3b6fbec69f25ecb28d6ec7aa6e91b41d7eabe70bdf7d7f217bf62 | sdiehl/elliptic-curve | Field.hs | module Test.Field where
import Protolude
import Data.Field.Galois hiding (recip)
import Test.Tasty
import Test.Tasty.QuickCheck
annihilation :: Eq a => (a -> a -> a) -> a -> a -> Bool
annihilation op e x = op x e == e && op e x == e
associativity :: Eq a => (a -> a -> a) -> a -> a -> a -> Bool
associativity op x y ... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/test/Test/Field.hs | haskell | module Test.Field where
import Protolude
import Data.Field.Galois hiding (recip)
import Test.Tasty
import Test.Tasty.QuickCheck
annihilation :: Eq a => (a -> a -> a) -> a -> a -> Bool
annihilation op e x = op x e == e && op e x == e
associativity :: Eq a => (a -> a -> a) -> a -> a -> a -> Bool
associativity op x y ... | |
27d8a3779097b55e09171fab372804f0e01b7467997959f80279d42a617b645a | opencog/opencog | eva-behavior.scm | ;
Personality / Behavior scheme module for the robot .
; Defines a "personality" in terms of a set of configurable behavior
; trees.
(define-module (opencog eva-behavior))
(use-modules (opencog) (opencog nlp))
(use-modules (opencog eva-model))
; Load various parts....
; Note: we load cfg-eva.scm by default The ot... | null | https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/opencog/eva/behavior/eva-behavior.scm | scheme |
Defines a "personality" in terms of a set of configurable behavior
trees.
Load various parts....
Note: we load cfg-eva.scm by default The other cfg-files can
over-ride the defaults set there, easily enough. But at least | Personality / Behavior scheme module for the robot .
(define-module (opencog eva-behavior))
(use-modules (opencog) (opencog nlp))
(use-modules (opencog eva-model))
cfg - eva gives us enough to work on .
(load "eva-behavior/cfg-tools.scm")
(load "eva-behavior/cfg-eva.scm")
(load "eva-behavior/express.scm")
(load... |
280b57b30fc6358f9f328a208a811093efbe399b416d17a58d734b69311a9189 | tfausak/exercism-solutions | Gigasecond.hs | module Gigasecond
( fromDay
) where
import Data.Time.Calendar (Day, addDays)
fromDay :: Day -> Day
fromDay = addDays (floor $ 10 ^ 9 / 60 / 60 / 24)
| null | https://raw.githubusercontent.com/tfausak/exercism-solutions/5e6f93979cc61ef5e3b48a09ca316dfd7fcd319c/haskell/gigasecond/Gigasecond.hs | haskell | module Gigasecond
( fromDay
) where
import Data.Time.Calendar (Day, addDays)
fromDay :: Day -> Day
fromDay = addDays (floor $ 10 ^ 9 / 60 / 60 / 24)
| |
9624c53d7a44c7dc7d13c2bb2845565cb54537679de86fbf4fe6f17ae6c27d98 | halturin/mx | mx_sup.erl | Copyright ( C ) 2015 < >
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
%% to use, copy, modify, merge, publish, distr... | null | https://raw.githubusercontent.com/halturin/mx/4ccce0f7233aea255576b9d01c0114d5ab4b199f/src/mx_sup.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice ... | Copyright ( C ) 2015 < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
... |
657df61aec96bdd4ae626cb460dc48a11acb7379d4e8f703ebdebfd7c8c3b3a5 | mbutterick/aoc-racket | main2.rkt | #lang reader "../aoc-lang.rkt"
(provide (rename-out [#%mb #%module-begin]) ★★)
(define-macro (#%mb (STARS) TOKS ...)
#`(#%module-begin
(time (STARS (vector (λ () TOKS) ...)))))
(define cur-program (make-parameter #f))
(define cur-receiver (make-parameter #f))
(provide snd set add mul mod rcv jgz)
(define-macr... | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2017/d18/main2.rkt | racket | #lang reader "../aoc-lang.rkt"
(provide (rename-out [#%mb #%module-begin]) ★★)
(define-macro (#%mb (STARS) TOKS ...)
#`(#%module-begin
(time (STARS (vector (λ () TOKS) ...)))))
(define cur-program (make-parameter #f))
(define cur-receiver (make-parameter #f))
(provide snd set add mul mod rcv jgz)
(define-macr... | |
a0b59fd4bf0ab548f39efa5be9c95272fdf64e97245877b12f86c02ee8166029 | huangjs/cl | zgemv.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l ,... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/share/lapack/blas/zgemv.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rt... |
08bc608333be1b781802970c4279b246b673aeceb15a6168e2202ad4e34c43e3 | irastypain/sicp-on-language-racket | exercise_1_02.rkt | #lang racket
(define expression
(/ (+ 5 4 (- 2
(- 3
( + 6
(/ 4 5)))))
(* 3
(- 6 2)
(- 2 7))))
(provide expression)
| null | https://raw.githubusercontent.com/irastypain/sicp-on-language-racket/0052f91d3c2432a00e7e15310f416cb77eeb4c9c/src/chapter01/exercise_1_02.rkt | racket | #lang racket
(define expression
(/ (+ 5 4 (- 2
(- 3
( + 6
(/ 4 5)))))
(* 3
(- 6 2)
(- 2 7))))
(provide expression)
| |
babed5e6bdb4b99c700bddf7df4c0420ff4fc56cb8763ab06e7e5cd043d433f1 | alexandergunnarson/quantum | core.cljc | (ns quantum.apis.amazon.cloud-drive.core
(:refer-clojure :exclude [meta reduce val assoc!])
(:require
[clojure.core.async :as async
:refer [<!]]
[quantum.auth.core :as auth]
[quantum.core.convert :as conv]
[quantum.apis.amazon.cloud-drive.au... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/apis/amazon/cloud_drive/core.cljc | clojure | (http/request! {:url "" :oauth-token ...})
; upload POST : {{contentUrl}}/nodes Upload a new file & its metadata
overwrite PUT : { { contentUrl}}/nodes/{id}/content Overwrite the content of a file
)
; As of right now permanently deleting content is not available through the Amazon Cloud Drive API.
:id
TODO ... | (ns quantum.apis.amazon.cloud-drive.core
(:refer-clojure :exclude [meta reduce val assoc!])
(:require
[clojure.core.async :as async
:refer [<!]]
[quantum.auth.core :as auth]
[quantum.core.convert :as conv]
[quantum.apis.amazon.cloud-drive.au... |
7863e09071c57e892886613602c824cbf94e616f0fe52f491e393a99dbbb08e0 | brendanzab/language-garden | Algae.ml | * Based on Figure 1.3 in “ The Algorithmic Beauty of Plants ”
(* $MDX part-begin=grammar *)
* state of a cell
type symbol =
| A (** Large cell, ready to divide *)
| B (** Small cell *)
let axiom =
[B] (* Seed with a small cell *)
let rules =
function
| A -> [A; B] (*... | null | https://raw.githubusercontent.com/brendanzab/language-garden/5043080081cccad5576497b94719f5ecf06ba22f/lang-fractal-growth/examples/Algae.ml | ocaml | $MDX part-begin=grammar
* Large cell, ready to divide
* Small cell
Seed with a small cell
Divide
Grow
$MDX part-end
* {1 String interpretation} | * Based on Figure 1.3 in “ The Algorithmic Beauty of Plants ”
* state of a cell
type symbol =
let axiom =
let rules =
function
let string_of_symbol =
function
| A -> "a"
| B -> "b"
let string_of_word w =
List.map string_of_symbol w
|> String.concat ""
|
1bc9412b2181a74971aff506dfa04e924dcff5b4b2ab9b588c0e107d1dca6ee6 | ddssff/cabal-debian | CabalDebian.hs | import Debian.Debianize.Details (debianDefaults)
import Debian.Debianize.Output (performDebianizationOfWebsite)
main :: IO ()
main = performDebianizationOfWebsite debianDefaults
| null | https://raw.githubusercontent.com/ddssff/cabal-debian/763270aed987f870762e660f243451e9a34e1325/CabalDebian.hs | haskell | import Debian.Debianize.Details (debianDefaults)
import Debian.Debianize.Output (performDebianizationOfWebsite)
main :: IO ()
main = performDebianizationOfWebsite debianDefaults
| |
55b1ed3787a2863205a1ac232f60a2e786efa4575b03cee4904ec96d47148189 | leksah/leksah | Log.hs | module IDE.Pane.Log where
import Data.Text (Text)
import System.Process (ProcessHandle)
import IDE.Core.Types (MonadIDE, IDEAction, LogTag, IDEM)
import IDE.Gtk.Types (LogLaunch(..))
import IDE.Core.State (readIDE, logLineMap, modifyIDE_)
import Control.Lens ((%~))
import qualified Data.Map as M (size, insert)
data I... | null | https://raw.githubusercontent.com/leksah/leksah/ec95f33af27fea09cba140d7cddd010935a2cf52/src-nogtk/IDE/Pane/Log.hs | haskell | module IDE.Pane.Log where
import Data.Text (Text)
import System.Process (ProcessHandle)
import IDE.Core.Types (MonadIDE, IDEAction, LogTag, IDEM)
import IDE.Gtk.Types (LogLaunch(..))
import IDE.Core.State (readIDE, logLineMap, modifyIDE_)
import Control.Lens ((%~))
import qualified Data.Map as M (size, insert)
data I... | |
93739e760029f9f836bddaf0534a2b06adc288df0a64b851321db9fba492af81 | pirapira/coq2rust | geninterp.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/tactics/geninterp.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Interpretation functions for gener... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Genarg
modu... |
edb0fbf495b34214ff052aeac75a3ee7a888da77a23336ab1238e164397db9ab | samrocketman/home | gutteridge-fuzzy-border.scm | ;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Fuzzy border script for GIMP 2.4
( )
At ECS Dept , University of Southampton , England .
;
; Tags: border, fuzzy
;
; Author statement:
; Do a cool fade to a given colour at the border of an image (optional shadow)
; Will make imag... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/gutteridge-fuzzy-border.scm | scheme |
The GIMP -- an image manipulation program
Tags: border, fuzzy
Author statement:
Do a cool fade to a given colour at the border of an image (optional shadow)
Will make image RGB if it isn't already.
--------------------------------------------------------------------
----------------------------------------... | Copyright ( C ) 1995 and
Fuzzy border script for GIMP 2.4
( )
At ECS Dept , University of Southampton , England .
Distributed by Gimp FX Foundry project
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundat... |
4dd70fa8105e254d7e6c21ec3f8cf7f9a4b51f6bc1594ee2660f681221a29c77 | ocaml-gospel/gospel | ambiguous.mli | val f : int -> int
@ y = f x
ensures match x with
| _ | _ when x = 1 - > true
| _ - > false
ensures match x with
| _ | _ when x = 1 -> true
| _ -> false *)
{ gospel_expected|
[ 125 ] File " ambiguous.mli " , line 3 , characters 12 - 72 :
3 | ............ match x with
... | null | https://raw.githubusercontent.com/ocaml-gospel/gospel/79841c510baeb396d9a695ae33b290899188380b/test/patterns/negative/ambiguous.mli | ocaml | val f : int -> int
@ y = f x
ensures match x with
| _ | _ when x = 1 - > true
| _ - > false
ensures match x with
| _ | _ when x = 1 -> true
| _ -> false *)
{ gospel_expected|
[ 125 ] File " ambiguous.mli " , line 3 , characters 12 - 72 :
3 | ............ match x with
... | |
1803452d5c6cf332c143c29545ecb797426f74e3c6211956dbf1605159974070 | aaltodsg/instans | dot.lisp | -*- Mode : Lisp ; Syntax : COMMON - LISP ; Base : 10 ; Package : INSTANS -*-
;;;
Author : ( )
;;;
(in-package #:instans)
(defun dot-node-number (node)
(let* ((name-string (string (node-name node)))
(pos (position-if-not #'digit-char-p name-string :from-end t))
(num-string (subseq name-string (1+ pos))))
... | null | https://raw.githubusercontent.com/aaltodsg/instans/5ffc90e733e76ab911165f205ba57a7b3b200945/src/rete/dot.lisp | lisp | Syntax : COMMON - LISP ; Base : 10 ; Package : INSTANS -*-
(var-names this (node-use this))
(var-names this (node-use-succ this)))
do (inform "var = ~S" var)
(inform "(directoryp ~A) = ~A" html-file (directoryp html-file))
do (inform "algebra-expr:~%~A" expr) | Author : ( )
(in-package #:instans)
(defun dot-node-number (node)
(let* ((name-string (string (node-name node)))
(pos (position-if-not #'digit-char-p name-string :from-end t))
(num-string (subseq name-string (1+ pos))))
( inform " dot - node - number ~A , name - string = ~S , pos = ~S , num - string =... |
876d288f90ac580487c4712434e7feaa28cde1e0746eacdf85c22fd4b603dcad | ferd/ReVault | revault_data_wrapper.erl | @doc Data wrapper for revault 's FSMs , dealing with creating a data
%%% representation for common stateful operations.
%%%
One important thing to note is that while we expect the server - side
%%% (with an already-created ID) to exist, we can't make that assumption
%%% from the client side if it does not exist yet... | null | https://raw.githubusercontent.com/ferd/ReVault/37929d694a0246c12ad32f595544b9c654a832ec/apps/revault/src/revault_data_wrapper.erl | erlang | representation for common stateful operations.
(with an already-created ID) to exist, we can't make that assumption
from the client side if it does not exist yet, since booting it
through `revault_dirmon_tracker' requires passing in the seed ID.
This implies that the ID will be stored somewhere stateful, but the... | @doc Data wrapper for revault 's FSMs , dealing with creating a data
One important thing to note is that while we expect the server - side
-module(revault_data_wrapper).
-export([peer/1, peer/2, new/0, ask/0, ok/0, error/1, fork/2]).
-export([manifest/0, manifest/1, send_file/4, send_deleted/2,
send_confli... |
eea4321d35fb538194a441506eae591f90b124522606a4001196e3cb04a73679 | gregnwosu/haskellbook | Exercises.hs | {-# LANGUAGE RankNTypes #-}
module Exercises where
import Control.Applicative
import Test.QuickCheck
import Test.QuickCheck.Function
a_ = fmap (+1) $ read "[1]"::[Int]
b_ = (fmap.fmap) (++ "lol") (Just ["Hi", "Hello"])
c_ = fmap (*2) (\x -> x -2)
d_ = fmap ((return '1' ++ ) . show) (\x -> [x, 1..3])
e_ :: IO Integer
e... | null | https://raw.githubusercontent.com/gregnwosu/haskellbook/b21fb6772e58f07cff334d9c551d0477ec856897/chapter16/Exercises.hs | haskell | # LANGUAGE RankNTypes #
degenerateMtl Nothing = []
degenerateMtl (Just a) = [ a + 1] | module Exercises where
import Control.Applicative
import Test.QuickCheck
import Test.QuickCheck.Function
a_ = fmap (+1) $ read "[1]"::[Int]
b_ = (fmap.fmap) (++ "lol") (Just ["Hi", "Hello"])
c_ = fmap (*2) (\x -> x -2)
d_ = fmap ((return '1' ++ ) . show) (\x -> [x, 1..3])
e_ :: IO Integer
e_ =
let
ioi = readIO "1"... |
7d85b169db9ff466b91ece3460d6bddcd1885dfd1d5dd72354fc7eecaecfaedc | nikomatsakis/a-mir-formality | normalization-not-coinductive.rkt | #lang racket
(require redex/reduction-semantics
"../../util.rkt"
"../grammar.rkt"
"../prove.rkt"
)
(module+ test
(traced '()
(test-equal
(term (rust:can-prove-where-clause-in-program
([(crate C { (trait Foo[] where [] { (type FooItem[] : [] ... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/71be4d5c4bd5e91d326277eaedd19a7abe3ac76a/racket-src/rust/test/normalization-not-coinductive.rkt | racket | #lang racket
(require redex/reduction-semantics
"../../util.rkt"
"../grammar.rkt"
"../prove.rkt"
)
(module+ test
(traced '()
(test-equal
(term (rust:can-prove-where-clause-in-program
([(crate C { (trait Foo[] where [] { (type FooItem[] : [] ... | |
5f2a420e9878c9e4a7552b92d05b6883c7a18c11f2d4a99080a9b691632ea6ab | dancrossnyc/multics | tdv2220.ctl.lisp | ;;; ***********************************************************
;;; * *
* Copyright , ( C ) Honeywell Information Systems Inc. , 1982 *
;;; * *
;;; **********************************************************... | null | https://raw.githubusercontent.com/dancrossnyc/multics/dc291689edf955c660e57236da694630e2217151/library_dir_dir/system_library_unbundled/source/bound_emacs_ctls_.s.archive/tdv2220.ctl.lisp | lisp | ***********************************************************
* *
* *
***********************************************************
HISTORY COMMENTS:
audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136... | * Copyright , ( C ) Honeywell Information Systems Inc. , 1982 *
1 ) change(86 - 04 - 23,Margolin ) , approve(86 - 04 - 23,MCR7325 ) ,
bb 1981 - 08 - 19
(%include e-macros)
(declare (special X Y screenheight screenlinelen ospeed))
(declare (special idel-lines-availablep idel-chars-availablep tty-type))... |
da12f08f8937152606ff67fd6b0f9a21088cbcd2acf712241819b283c8888660 | typedclojure/typedclojure | collect_utils.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/45556897356f3c9cbc7b1b6b4df263086a9d5803/typed/clj.checker/src/typed/cljc/checker/collect_utils.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns typed.cljc.checker.collect-utils
(:require [typed.cljc.checker.type-ctors :as c]
[typed.cljc.checker.type-rep :as r]))
(defn protocol-method-var-ann [mt names bnds]
(cond
(r/Poly? mt) (let [outer-names names
inner-names (concat... |
0866b11ef69b1a3c0b3633cd4fe1102a240b45eb787f4137ee59d6bd446d5d70 | MLanguage/mlang | mlexer.mli | Copyright ( C ) 2019 - 2021 Inria , contributor :
< >
This program is free software : you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at your option ) any later
... | null | https://raw.githubusercontent.com/MLanguage/mlang/a8749761a48b47e28ecc4a0390b3873615d2a9b5/src/mlang/m_frontend/mlexer.mli | ocaml | Copyright ( C ) 2019 - 2021 Inria , contributor :
< >
This program is free software : you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at your option ) any later
... | |
33d5e420e1c2cb33d1416467362e24ef82c6206fac2bdd1e74dc823e8ec54e38 | jakemcc/sicp-study | ex4_30.clj | Exercise 4.30
a ) Each element gets evaluated as the first argument in the begin s - exp .
; The display s-exp causes the value to be realized since display is
; primitive.
; b) original eval-sequence:
( p1 1 ) = > ' ( 1 2 )
( p2 1 ) = > 1
; new eval-sequence:
( p1 1 ) = > ' ( 1 2... | null | https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section4.2/src/ex4_30.clj | clojure | The display s-exp causes the value to be realized since display is
primitive.
b) original eval-sequence:
new eval-sequence:
c) The example already calls a primitive on each element
in the list. Calling actual-value on it as well doesn't do anything
bad.
side effects in a better way. As someone... | Exercise 4.30
a ) Each element gets evaluated as the first argument in the begin s - exp .
( p1 1 ) = > ' ( 1 2 )
( p2 1 ) = > 1
( p1 1 ) = > ' ( 1 2 )
( p2 1 ) = > ' ( 1 2 )
d ) I actually like Cy 's approach better . It seems to be like it handles |
8cf617e72a1c0ec474b13bf538b478f825fa4c056e7786aef3926f66ce3f0c55 | CryptoKami/cryptokami-core | Dump.hs | -- | Generation of genesis data for testnet.
module Dump
( dumpRichSecrets
, dumpFakeAvvmSeed
, dumpGeneratedGenesisData
) where
import Universum
import Control.Lens ((?~))
import qualified Data.Text as T
import Serokell.Util (enumerate)
import qualified Sero... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/tools/src/keygen/Dump.hs | haskell | | Generation of genesis data for testnet.
--------------------------------------------------------------------------
Dump individual secrets
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Dump all generated secrets... |
module Dump
( dumpRichSecrets
, dumpFakeAvvmSeed
, dumpGeneratedGenesisData
) where
import Universum
import Control.Lens ((?~))
import qualified Data.Text as T
import Serokell.Util (enumerate)
import qualified Serokell.Util.Base64 as B64
import Syst... |
471f9611cc5f23247b6cc8c85ac5b85795389792f8a0c5a2ee8797999445b3b8 | ogaml/ogaml | circles.ml | open OgamlGraphics
open OgamlMath
let settings =
OgamlCore.ContextSettings.create
~msaa:8
~resizable:true
~fullscreen:false
()
let window =
Window.create ~width:900 ~height:600 ~settings ~title:"Circles Example"
let circles =
let delta = Vector2i.({ x = 401 ; y = 0 }) in
let rec compute l pos... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/examples/circles.ml | ocaml | open OgamlGraphics
open OgamlMath
let settings =
OgamlCore.ContextSettings.create
~msaa:8
~resizable:true
~fullscreen:false
()
let window =
Window.create ~width:900 ~height:600 ~settings ~title:"Circles Example"
let circles =
let delta = Vector2i.({ x = 401 ; y = 0 }) in
let rec compute l pos... | |
3807a7a163d900ddae816a0c9c85c0319171c6403c20ed36cc8c5cfd41049ce8 | vlstill/hsExprTest | Compat.hs | # LANGUAGE CPP #
module Test.Expr.Internal.Compat where
import Language.Haskell.TH ( Exp )
#if MIN_VERSION_template_haskell(2,16,0)
wrapTupElemE :: Exp -> Maybe Exp
wrapTupElemE = Just
#else
wrapTupElemE :: Exp -> Exp
wrapTupElemE = id
#endif
| null | https://raw.githubusercontent.com/vlstill/hsExprTest/0c7754979cf837d48f5740674639e2decb96e547/testlib/Test/Expr/Internal/Compat.hs | haskell | # LANGUAGE CPP #
module Test.Expr.Internal.Compat where
import Language.Haskell.TH ( Exp )
#if MIN_VERSION_template_haskell(2,16,0)
wrapTupElemE :: Exp -> Maybe Exp
wrapTupElemE = Just
#else
wrapTupElemE :: Exp -> Exp
wrapTupElemE = id
#endif
| |
95ebe18aee5d09705c22aa09e0b948350a1dea6ab87ac4e1322693065cccb62c | ArulselvanMadhavan/haskell-first-principles | Ex1.hs | module Ex1 where
import Moi
type State' = Moi
get :: State' s s
get = Moi (\s -> (s, s))
put :: s -> State' s ()
put s = Moi (\ss -> ((), s))
exec :: State' s a -> s -> s
exec (Moi sa) = snd . sa
eval :: State' s a -> s -> a
eval (Moi sa) = fst . sa
modify :: (s -> s) -> State' s ()
modify f = Moi (\s ... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter23/src/Ex1.hs | haskell | module Ex1 where
import Moi
type State' = Moi
get :: State' s s
get = Moi (\s -> (s, s))
put :: s -> State' s ()
put s = Moi (\ss -> ((), s))
exec :: State' s a -> s -> s
exec (Moi sa) = snd . sa
eval :: State' s a -> s -> a
eval (Moi sa) = fst . sa
modify :: (s -> s) -> State' s ()
modify f = Moi (\s ... | |
62a170952dbff80d1070964e114a2f06e1ff41dc0aa7a7eb983b38e1790e68c1 | yuriy-chumak/ol | list-extra.scm | (define-library (owl list-extra)
(export
lref lset ldel
led ledn lins
take drop lrange; iota
repeat
split ;; lst n → head tail
)
(import
(scheme core)
(owl math)
(owl list)
(otus async)) ;?
(begin
(define lref list-ref)
(define-syntax ... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/c005c96f4dd17fc7dcf78560c8878e002b0f3b38/libraries/owl/list-extra.scm | scheme | iota
lst n → head tail
?
TEMP
list edit - apply op to value at given pos
insert value to list at given position
take at n (or less) elemts from list l
drop n elements (or less) from list l | (define-library (owl list-extra)
(export
lref lset ldel
led ledn lins
repeat
)
(import
(scheme core)
(owl math)
(owl list)
(begin
(define lref list-ref)
(define (lset lst pos val)
(cond
((null? lst) (runtime-error "list-set: out of... |
77f87adaa450563891a27edc3a32691fc597d6296209ead38a36eba7842f20b4 | s3team/Amoeba | dataflow.ml | open Bitstring
open Type
open Pp_print
open Ail_utils
type df_direction = Forward | Backward
class dataFlow (instr_list : instr list) (dir : df_direction) (cfg_t) =
object (self)
(* Accessors to query about the solution.*)
(* the in-set is only available for forward problems *)
... | null | https://raw.githubusercontent.com/s3team/Amoeba/50ab9027afc2ca90fed21ecafa309a75b3e89ea2/src/dataflow.ml | ocaml | Accessors to query about the solution.
the in-set is only available for forward problems
the out-set is only available for backward problems
Functions needs by the solver. Must be implemented by the actual problems
get initial state for state for the nodes.
transfer inset -> gen -> kill -> BitString
confluenc... | open Bitstring
open Type
open Pp_print
open Ail_utils
type df_direction = Forward | Backward
class dataFlow (instr_list : instr list) (dir : df_direction) (cfg_t) =
object (self)
method getInSet bb =
assert(direction = Forward);
df_solution.find(bb).second
... |
b4df459e328406eff03426a5fdf61076c255a9511bbad41041920bba5bea5ef4 | ds-wizard/engine-backend | DocumentDAO.hs | module Wizard.Database.DAO.Document.DocumentDAO where
import Control.Monad.Reader (asks)
import Data.Maybe
import Data.String
import qualified Data.UUID as U
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.ToField
import GHC.Int
import Shared.Model.Common.Page
import Shared.Model.Common.Pageable
i... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Database/DAO/Document/DocumentDAO.hs | haskell | --------------------------------
PRIVATE
-------------------------------- | module Wizard.Database.DAO.Document.DocumentDAO where
import Control.Monad.Reader (asks)
import Data.Maybe
import Data.String
import qualified Data.UUID as U
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.ToField
import GHC.Int
import Shared.Model.Common.Page
import Shared.Model.Common.Pageable
i... |
b15fe88cb6a32ad07c2e577b91dda772a6baafb2c11b96619c515b9ec60fa826 | aloiscochard/sarsi | Main.hs | module Main where
import Codec.Sarsi (Event (..), Level (..), Location (..), Message (..))
import Control.Concurrent.MVar (MVar, newMVar, readMVar, swapMVar)
import qualified Data.List as List
import Data.Machine (ProcessT, asParts, final, runT, scan, sinkPart_, (<~))
import Data.Text (Text, pack)
import qualified Dat... | null | https://raw.githubusercontent.com/aloiscochard/sarsi/1f961bf3311f8c6f00ef4d0ce253e3fbdfe342a4/sarsi-vi/Main.hs | haskell | :set efm=%f:%l:%c:%t\ %m | module Main where
import Codec.Sarsi (Event (..), Level (..), Location (..), Message (..))
import Control.Concurrent.MVar (MVar, newMVar, readMVar, swapMVar)
import qualified Data.List as List
import Data.Machine (ProcessT, asParts, final, runT, scan, sinkPart_, (<~))
import Data.Text (Text, pack)
import qualified Dat... |
51a61f7a8b1bb1bde4ef33a33fc7e06dfa81440bfb04a06696289e2c4c4aa784 | GillianPlatform/Gillian | report_id.mli | * @canonical . Logging . Report_id
type t = int64 [@@deriving yojson]
val next : unit -> t
val equal : t -> t -> bool
val pp : Format.formatter -> t -> unit
| null | https://raw.githubusercontent.com/GillianPlatform/Gillian/c794de7417f29e3c23146f9958ead7e4ad0216ce/GillianCore/logging/report_id.mli | ocaml | * @canonical . Logging . Report_id
type t = int64 [@@deriving yojson]
val next : unit -> t
val equal : t -> t -> bool
val pp : Format.formatter -> t -> unit
| |
ecfa64c5725663753abda78ff7af64a1c31d37ad5dad5a0532adccea4077366b | tweag/ormolu | double-dot-with-names-out.hs | # LANGUAGE PatternSynonyms #
module ExportSyntax (A (.., NoA), Q (F, ..), G (T, .., U)) where
data A = A | B
pattern NoA = B
data Q a = Q a
pattern F a = Q a
data G = G | H
pattern T = G
pattern U = H
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/module-header/double-dot-with-names-out.hs | haskell | # LANGUAGE PatternSynonyms #
module ExportSyntax (A (.., NoA), Q (F, ..), G (T, .., U)) where
data A = A | B
pattern NoA = B
data Q a = Q a
pattern F a = Q a
data G = G | H
pattern T = G
pattern U = H
| |
6d25915a9013302473acdd84b1664963c06c0499c3b0b7c95c865839aa7a3633 | tanakh/ICFP2011 | KyoukoReviveYose2.hs | # LANGUAGE CPP #
{-# OPTIONS -Wall #-}
import Control.Applicative
import qualified Control.Exception.Control as E
import Control.Monad
import Control.Monad.State
import Data.Maybe
import LTG
getFirstWorthEnemy :: Int -> LTG (Maybe Int)
getFirstWorthEnemy dmg = do
alives <- filterM
(\ix -> do
... | null | https://raw.githubusercontent.com/tanakh/ICFP2011/db0d670cdbe12e9cef4242d6ab202a98c254412e/ai/KyoukoReviveYose2.hs | haskell | # OPTIONS -Wall #
dec
S (K f) (K g)
lprint $ "Reusing " ++ show f
lprint $ "Failed reusing " ++
show f ++ " [expected " ++ show lval ++ " but was " ++ show ff ++ "]"
f1, f2: temp
f4
target: zombie target
v[f4] <- S (S Help I) (lazyApply Copy f8)
S (S Help I)
temporary fix
num f8 dmg
v[f8] <- (lazy... | # LANGUAGE CPP #
import Control.Applicative
import qualified Control.Exception.Control as E
import Control.Monad
import Control.Monad.State
import Data.Maybe
import LTG
getFirstWorthEnemy :: Int -> LTG (Maybe Int)
getFirstWorthEnemy dmg = do
alives <- filterM
(\ix -> do
al <- isAlive ... |
f7f9a544adc2b067ec9819011ff4a700e620122c6dcca6f1550678d0db96cdff | haskell/hackage-server | MemSize.hs | # LANGUAGE FlexibleInstances #
module Distribution.Server.Framework.MemSize (
MemSize(..),
memSizeMb, memSizeKb,
memSize0, memSize1, memSize2, memSize3, memSize4, memSize5,
memSize6, memSize7, memSize8, memSize9, memSize10, memSize11,
memSize12, memSize13, memSizeUArray, memSizeUVector
) where
import Data.... | null | https://raw.githubusercontent.com/haskell/hackage-server/4d0bd17b1b90f495b59d3e3a6e88e04411b78024/src/Distribution/Server/Framework/MemSize.hs | haskell | -----------------------------------------------------------------------------
Mem size class and instances
memSize xs = 2 + length xs + sum (map memSize xs)
estimate
estimate
We have
- 1 word for the 'SBS' object header
- 1 word for the pointer to the byte array object
- 1 word for the byte array object hea... | # LANGUAGE FlexibleInstances #
module Distribution.Server.Framework.MemSize (
MemSize(..),
memSizeMb, memSizeKb,
memSize0, memSize1, memSize2, memSize3, memSize4, memSize5,
memSize6, memSize7, memSize8, memSize9, memSize10, memSize11,
memSize12, memSize13, memSizeUArray, memSizeUVector
) where
import Data.... |
be41e0ae4b6173bfba57331026ae31d0722a729b935cb3e1741b997b4e7c7b77 | zotonic/zotonic | survey_q_likert.erl | @author < >
2011
Copyright 2011
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, softwar... | null | https://raw.githubusercontent.com/zotonic/zotonic/8a2b3948d4e785b6148a4de16c7c72431d569bb1/apps/zotonic_mod_survey/src/questions/survey_q_likert.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | @author < >
2011
Copyright 2011
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(survey_q_likert).
-export([
answer/3,
prep_chart/3,
prep_answer_header/2,
prep_answer/3,
prep_block/... |
85f21eb4b922db93353281a766370230cb925fb6ad2a9d5fe9ad06ca5c1e3408 | polymeris/cljs-aws | support.cljs | (ns cljs-aws.support
(:require [cljs-aws.base.requests])
(:require-macros [cljs-aws.base.service :refer [defservice]]))
(defservice "Support" "support-2013-04-15.min.json")
| null | https://raw.githubusercontent.com/polymeris/cljs-aws/3326e7c4db4dfc36dcb80770610c14c8a7fd0d66/src/cljs_aws/support.cljs | clojure | (ns cljs-aws.support
(:require [cljs-aws.base.requests])
(:require-macros [cljs-aws.base.service :refer [defservice]]))
(defservice "Support" "support-2013-04-15.min.json")
| |
f8d9201f9406e57cd5de77b8576962c33b89d2fe29d2141db12d0b40f0439136 | serokell/qtah | QShowEvent.hs | This file is part of Qtah .
--
Copyright 2015 - 2018 The Qtah Authors .
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your option) ... | null | https://raw.githubusercontent.com/serokell/qtah/abb4932248c82dc5c662a20d8f177acbc7cfa722/qtah-generator/src/Graphics/UI/Qtah/Generator/Interface/Gui/QShowEvent.hs | haskell |
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | This file is part of Qtah .
Copyright 2015 - 2018 The Qtah Authors .
the Free Software Foundation , either version 3 of the License , or
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
module Graphics.UI.Qtah.Generator.Interface.Gu... |
63f0e2a1f3ba828e470a6a77678060c3f1957ee98a2d56e3953c0c898ff0633e | onedata/op-worker | luma_external_feed.erl | %%%-------------------------------------------------------------------
@author
( C ) 2020 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
This module contains functions for a... | null | https://raw.githubusercontent.com/onedata/op-worker/b09f05b6928121cec4d6b41ce8037fe056e6b4b3/src/modules/storage/luma/feeds/luma_external_feed.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
from external feed.
WARNING!!!
module to populate the database.
DO NOT USE IT TO FETCH MAPPINGS!!!
@end
---------------------------------------------------------------... | @author
( C ) 2020 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
This module contains functions for acquiring mappings for LUMA DB
Functions from this module shall be called only internally by
-module(luma_external_feed).
-author("Jakub Kudzia").
-include("... |
f9cc942ced520527bd8e5e253b755876dd91fdfbb3acd684be0f0aee2cb134d7 | mathematical-systems/clml | zrotg.lisp | ;;; Compiled by f2cl version:
( " $ I d : f2cl1.l , v 1.209 2008/09/11 14:59:55 rtoy Exp $ "
" $ I d : f2cl2.l , v 1.37 2008/02/22 22:19:33 "
" $ I d : f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Rel $ "
" $ I d : f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Rel $ "
" $ I d : f2cl5.l , v 1.197 2008/09/11 15:0... | null | https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/blas/zrotg.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t)
(:relaxed-array-decls t) (:coerce-assigns :as-needed)
(:array-type ':array) (:array-slicing t)
(:declare-common nil) (:float-format double-float)) | ( " $ I d : f2cl1.l , v 1.209 2008/09/11 14:59:55 rtoy Exp $ "
" $ I d : f2cl2.l , v 1.37 2008/02/22 22:19:33 "
" $ I d : f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Rel $ "
" $ I d : f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Rel $ "
" $ I d : f2cl5.l , v 1.197 2008/09/11 15:03:25 rtoy Exp $ "
" $ I d :... |
3ecd9c7809647ea2f0662d61ddf41b1336b79ddc25d5e20053955f5cddc4b6ba | earl-ducaine/cl-garnet | menu-group.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
(in-package "USER" :use '("LISP" "KR"))
(defvar MENU-GROUP-INIT
(dolist (gadget '("menu-loader"
"scrolling-menu-loader"
"text-buttons-loader"
"x-buttons-loader"
"radio-buttons-loader"
"menubar-loader"
"option-button-lo... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/doc/previous-version/src/gadgets/garnet-code/menu-group.lisp | lisp | Syntax : Common - Lisp ; Package : USER ; Base : 10 -*- |
(in-package "USER" :use '("LISP" "KR"))
(defvar MENU-GROUP-INIT
(dolist (gadget '("menu-loader"
"scrolling-menu-loader"
"text-buttons-loader"
"x-buttons-loader"
"radio-buttons-loader"
"menubar-loader"
"option-button-loader"
"popup-menu-button-loader"
))
(load (merge-pathnames gadget
... |
405a486d47eacbb829d489ccb1dfe1064a74e95f53f00159c3b27350861fd694 | UU-ComputerScience/uhc | all-ok1.hs | -- data types, list, list comprehension
error :: forall a . [Char] -> a
concatMap :: (a -> [b]) -> [a] -> [b]
data ''[]'' a = a : [a]
| ''[]''
data Bool = False | True
x :: [Int]
x = [3]
y = [ w | z <- x, f z, f v, let w = z ]
where f :: forall a . a -> Bool
f x = True
v | True = v3
... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/5/all-ok1.hs | haskell | data types, list, list comprehension
s :: Int |
error :: forall a . [Char] -> a
concatMap :: (a -> [b]) -> [a] -> [b]
data ''[]'' a = a : [a]
| ''[]''
data Bool = False | True
x :: [Int]
x = [3]
y = [ w | z <- x, f z, f v, let w = z ]
where f :: forall a . a -> Bool
f x = True
v | True = v3
| False = v4
where v3 ... |
a9bbfcc2ebf500f42191b967aa6282201cc36054e34d90a3a56b664ec890fb89 | Bike/hominy | compilation-environment.lisp | (in-package #:hominy/cenv)
;;; Info about a variable binding.
;;; This is an object instead of just the info because compilers may
;;; subclass it to store other, compiler-specific information.
(defclass binding ()
((%info :initarg :info :initform (info:default-info) :reader info :type info:info)))
(defclass cenvir... | null | https://raw.githubusercontent.com/Bike/hominy/ee8bb886d26f9c04eadf978ddbf4141c687b0c74/compilation-environment.lisp | lisp | Info about a variable binding.
This is an object instead of just the info because compilers may
subclass it to store other, compiler-specific information.
An alist (symbol . binding)
A boolean indicating whether this environment may have additional, unknown bindings.
Note that this does not include any parent env... | (in-package #:hominy/cenv)
(defclass binding ()
((%info :initarg :info :initform (info:default-info) :reader info :type info:info)))
(defclass cenvironment ()
A list of CENVIRONMENTs .
(%parents :initarg :parents :reader parents :type list)
(%bindings :initarg :bindings :reader bindings :type list)
(%com... |
195366837ba180133e175060e0faa80f359a0720fff2113d0b91e9bea7111456 | AndrasKovacs/elaboration-zoo | Presyntax.hs |
module Presyntax where
import Common
data Tm
= Var Name -- x
\x . t | \{x } . t | \{x = y } . t |
-- \(x : A). t | \{x : A}. t
| App Tm Tm (Either Name Icit) -- t u | t {u} | t {x = u}
| U ... | null | https://raw.githubusercontent.com/AndrasKovacs/elaboration-zoo/f2d5ba52d73d4cd5a0b1b7996423844d375fa22d/06-first-class-poly/Presyntax.hs | haskell | x
\(x : A). t | \{x : A}. t
t u | t {u} | t {x = u}
U
(x : A) -> B | {x : A} -> B
let x : A = t; u
source position for error reporting
_
| Get rid of source positions, for better debug printing. |
module Presyntax where
import Common
data Tm
\x . t | \{x } . t | \{x = y } . t |
deriving Show
stripPos :: Tm -> Tm
stripPos = \case
Var x -> Var x
Lam x i ma t -> Lam x i (stripPos <$> ma) (stripPos t)
App t u i -> App (stripPos t) (stripPos u) i
U -> U
Pi x i a b -> Pi x i (s... |
ed0c56acb7c4ebeb895a1f170d5bca5d207e6eb4c600a26bf410256d782a45bf | ocaml-flambda/ocaml-jst | t16ok.ml | (* TEST
flags = " -w -a "
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
(* PR#4450 *)
module PR_4450_1 = struct
module type MyT = sig type 'a t = Succ of 'a t end
module MyMap(X : MyT) = X
module rec MyList : MyT = MyMap(MyList)
end;;
module PR_4450_2 = struct
module type MyT =... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/5bf2820278c58f6715dcfaf6fa61e09a9b0d8db3/testsuite/tests/typing-recmod/t16ok.ml | ocaml | TEST
flags = " -w -a "
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
PR#4450 |
module PR_4450_1 = struct
module type MyT = sig type 'a t = Succ of 'a t end
module MyMap(X : MyT) = X
module rec MyList : MyT = MyMap(MyList)
end;;
module PR_4450_2 = struct
module type MyT = sig
type 'a wrap = My of 'a t
and 'a t = private < map : 'b. ('a -> 'b) ->'b wrap; .. >
val create : 'a ... |
2b0d4a606070dba340f23af258d20dcc0e3fc231cace7ca22682b8134e4df1b0 | basho/riak_core | riak_core_vnode_master.erl | %% -------------------------------------------------------------------
%%
%% riak_vnode_master: dispatch to vnodes
%%
Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
e... | null | https://raw.githubusercontent.com/basho/riak_core/762ec81ae9af9a278e853f1feca418b9dcf748a3/src/riak_core_vnode_master.erl | erlang | -------------------------------------------------------------------
riak_vnode_master: dispatch to vnodes
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for th... | Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
502a70812a0b056ad2fd767917de78c01d6eaee7a8607e69bc7fa86bb8e7acd4 | V-Wong/COMP3141 | reverse.hs | module Main where
import Prelude hiding (reverse)
[ 1 , 2 , 3 ]
- > 3 : reverse [ 1 , 2 ]
- > 3 : ( 2 : reverse [ 1 ] )
- > 3 : ( 2 : ( 1 : [ ] ) )
- > [ 3 , 2 , 1 ]
reverse1 :: [a] -> [a]
reverse1 [] = []
reverse1 l = (last l) : (reverse1 (init l))
[ 1 , 2 , 3 ]
- > reverse [ 2 , 3 ] + + [ 1 ]
- > ( ... | null | https://raw.githubusercontent.com/V-Wong/COMP3141/f5a92e5833d2bb0a08e68cb2d025e38c8c875563/Random%20Code/reverse.hs | haskell | -> flip(1, flip(2, flip(3, []))) | module Main where
import Prelude hiding (reverse)
[ 1 , 2 , 3 ]
- > 3 : reverse [ 1 , 2 ]
- > 3 : ( 2 : reverse [ 1 ] )
- > 3 : ( 2 : ( 1 : [ ] ) )
- > [ 3 , 2 , 1 ]
reverse1 :: [a] -> [a]
reverse1 [] = []
reverse1 l = (last l) : (reverse1 (init l))
[ 1 , 2 , 3 ]
- > reverse [ 2 , 3 ] + + [ 1 ]
- > ( ... |
a88f51e8948506abd5eae7f8ad9d183ae9ae7369c3fe4ba0c2979da07702c21b | sgbj/MaximaSharp | dqc25c.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 46c1f6a93b0d 2012/05/03 04:40:28 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
;;; "f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/numerical/slatec/dqc25c.lisp | lisp | Compiled by f2cl version:
"f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 46c1f6a93b0d 2012/05/03 04:40:28 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl6.l , v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $ "
" macros.l , v fceac53... |
9129ae4df896cfc5fdbd1c984c71bdc37c494d9757b3aef66231eb380f4ba330 | cljfx/cljfx | subs.clj | (ns e18-pure-event-handling.subs
(:require [cljfx.api :as fx]
[clojure.string :as str]))
(defn current-request-id [context]
(peek (fx/sub-val context :history)))
(defn response-by-request-id [context request-id]
(fx/sub-val context get-in [:request-id->response request-id]))
(defn context-type [con... | null | https://raw.githubusercontent.com/cljfx/cljfx/ec3c34e619b2408026b9f2e2ff8665bebf70bf56/examples/e18_pure_event_handling/subs.clj | clojure | (ns e18-pure-event-handling.subs
(:require [cljfx.api :as fx]
[clojure.string :as str]))
(defn current-request-id [context]
(peek (fx/sub-val context :history)))
(defn response-by-request-id [context request-id]
(fx/sub-val context get-in [:request-id->response request-id]))
(defn context-type [con... | |
160c1c2651f550ea0be483f3a5ff69a80c843049c4bb54671c10e409557d75cd | paurkedal/ppx_regexp | ppx_regexp.ml | Copyright ( C ) 2017 - -2023 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... | null | https://raw.githubusercontent.com/paurkedal/ppx_regexp/18ca331c453d2762a4a841a5b74d7bf7d2ab5876/ppx_regexp/ppx_regexp.ml | ocaml | Copyright ( C ) 2017 - -2023 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... | |
c0bb313d93e2cab440f6fa43143a89e5db48f759520c5c88be2a92f6fb9e8386 | ucsd-progsys/nate | reloadgen.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/asmcomp/reloadgen.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1997 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : reloadgen.mli , v 1.4 1999/11... |
36da9fc1a4fbdc4bd14e946aba934c468135dff5a7b3e1d4c96cab83149139ff | tomjaguarpaw/haskell-opaleye | Table.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
|
Table fields can be required or optional and , independently , nullable or
non - nullable .
A required non - nullable @SqlInt4@ ( for example ) is defined with
' T.requiredTableField ' and gives rise to a
@
TableFields ( Field SqlIn... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/41b0f82d965edbde6a704911c7097600b8c26211/src/Opaleye/Table.hs | haskell | * Defining tables
* Selecting from tables
* Data types
* Explicit versions
* Deprecated versions
| Example type specialization:
@
selectTable :: Table w (Field a, Field b)
-> Select (Field a, Field b)
@
product type @Foo@:
@
selectTable :: Table w (Foo (Field a) (Field b) (Field c))
... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
|
Table fields can be required or optional and , independently , nullable or
non - nullable .
A required non - nullable @SqlInt4@ ( for example ) is defined with
' T.requiredTableField ' and gives rise to a
@
TableFields ( Field SqlIn... |
0a5a65283e1fa8d528a351d1cc24a8ac6da57982d9e58f23f69ee5865e20c7ae | robert-strandh/SICL | mir-to-lir.lisp | (cl:in-package #:sicl-mir-to-lir)
(defgeneric mir-to-lir (client mir))
(defun find-lexical-locations (enter-instruction)
(let ((result (make-hash-table :test #'eq))
(location 0))
(flet ((maybe-register-datum (datum)
(when (and (or (typep datum 'cleavir-ir:lexical-location)
... | null | https://raw.githubusercontent.com/robert-strandh/SICL/bd3ec8f991d9455541d1629a3c672ae3d46dc16d/Code/Compiler/MIR-to-LIR/mir-to-lir.lisp | lisp | (cl:in-package #:sicl-mir-to-lir)
(defgeneric mir-to-lir (client mir))
(defun find-lexical-locations (enter-instruction)
(let ((result (make-hash-table :test #'eq))
(location 0))
(flet ((maybe-register-datum (datum)
(when (and (or (typep datum 'cleavir-ir:lexical-location)
... | |
fb9564b0ffbb0dd3a7fee3f9327a4c5eef4f67d7724bbd8f7e4dc4305d448b8e | gafiatulin/codewars | AllProducts.hs | Get all possible products of two lists of numbers
--
module AllProducts where
import Control.Applicative(liftA2)
getProducts :: [Integer] -> [Integer] -> [Integer]
getProducts = flip $ liftA2 (*)
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/Beta/AllProducts.hs | haskell | Get all possible products of two lists of numbers
module AllProducts where
import Control.Applicative(liftA2)
getProducts :: [Integer] -> [Integer] -> [Integer]
getProducts = flip $ liftA2 (*)
| |
cc36e093933166cf0525a8a237b9f1c58417021fdbbf4bb7b4947e6989bc28f9 | nilenso/goose | broker.clj | (ns goose.brokers.rmq.broker
(:require
[goose.broker :as b]
[goose.brokers.rmq.api.dead-jobs :as dead-jobs]
[goose.brokers.rmq.api.enqueued-jobs :as enqueued-jobs]
[goose.brokers.rmq.commands :as rmq-cmds]
[goose.brokers.rmq.connection :as rmq-connection]
[goose.brokers.rmq.publisher-confirms ... | null | https://raw.githubusercontent.com/nilenso/goose/cf42be9a79f4d0a8c65a93d8cb850bdc666bccb2/src/goose/brokers/rmq/broker.clj | clojure | enqueued-jobs API
dead-jobs API | (ns goose.brokers.rmq.broker
(:require
[goose.broker :as b]
[goose.brokers.rmq.api.dead-jobs :as dead-jobs]
[goose.brokers.rmq.api.enqueued-jobs :as enqueued-jobs]
[goose.brokers.rmq.commands :as rmq-cmds]
[goose.brokers.rmq.connection :as rmq-connection]
[goose.brokers.rmq.publisher-confirms ... |
92a3c634c2da83df64c1f7614c025552a83aca3b752e1e407f1de03920b91fdc | argp/bap | coalesce.mli | * Coalesce sequential basic blocks into a single basic block .
A statement [ s ] is reorderable if [ s ] can be swapped with an
adjacent reorderable statement [ s2 ] without changing the semantics
of the program . For example , labels and comments are reorderable
statements .
A sequenc... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/ocaml/coalesce.mli | ocaml | * coalesce_ssa [cfg] returns a new SSA CFG in which sequential basic
blocks in [cfg] are coalesced into a single basic block. | * Coalesce sequential basic blocks into a single basic block .
A statement [ s ] is reorderable if [ s ] can be swapped with an
adjacent reorderable statement [ s2 ] without changing the semantics
of the program . For example , labels and comments are reorderable
statements .
A sequenc... |
730043aba37c8f398699b095612ed862436fcb23d70cb0637c1202514f52ba07 | ntoronto/drbayes | make-predicate-lift.rkt | #lang typed/racket/base
(require racket/promise
"../../set.rkt"
"../types.rkt"
"../cache.rkt")
(provide (all-defined-out))
(: predicate/bot (-> Symbol (-> Value (U Bottom Boolean)) Nonempty-Set Nonempty-Set (-> Bot-Arrow)))
(define (predicate/bot name f Xt Xf)
(: arg-error (-> Nonempty-S... | null | https://raw.githubusercontent.com/ntoronto/drbayes/e59eb7c7867118bf4c77ca903e133c7530e612a3/drbayes/private/arrow/pure-lifts/make-predicate-lift.rkt | racket | #lang typed/racket/base
(require racket/promise
"../../set.rkt"
"../types.rkt"
"../cache.rkt")
(provide (all-defined-out))
(: predicate/bot (-> Symbol (-> Value (U Bottom Boolean)) Nonempty-Set Nonempty-Set (-> Bot-Arrow)))
(define (predicate/bot name f Xt Xf)
(: arg-error (-> Nonempty-S... | |
42526b1807decfea9de10cd52dec78f715368a1e8e246d06494795c3022fb069 | expez/superstring | build.clj | (require '[cljs.build.api :as b])
(println "Building ...")
(let [start (System/nanoTime)]
(b/build
(b/inputs "test" "src")
{:main 'superstring.core-test
:output-to "out/tests.js"
:output-dir "out"
:target :nodejs
:verbose true})
(println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9... | null | https://raw.githubusercontent.com/expez/superstring/a24e30367b0bca2144ffd25fe78abe3cd0f42bb1/scripts/build.clj | clojure | (require '[cljs.build.api :as b])
(println "Building ...")
(let [start (System/nanoTime)]
(b/build
(b/inputs "test" "src")
{:main 'superstring.core-test
:output-to "out/tests.js"
:output-dir "out"
:target :nodejs
:verbose true})
(println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9... | |
c131077a83c6afa5e2887552f1380f6ed9101700ef2abe75905ada63403fcd04 | gheber/kenzo | combinations-test.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 - *
(in-package :kenzo-test-7)
(in-suite :kenzo-7)
(test f-cmpr
(is (equal (cat-7:f-cmpr 1 2) :less))
(is (equal (cat-7:f-cmpr 2 2) :equal))
(is (equal (cat-7:f-cmpr 3 2) :greater))
(is (equal (cat-7:f-cmpr 123 789) :less))
(... | null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/test/kenzo-7/combinations-test.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 - * |
(in-package :kenzo-test-7)
(in-suite :kenzo-7)
(test f-cmpr
(is (equal (cat-7:f-cmpr 1 2) :less))
(is (equal (cat-7:f-cmpr 2 2) :equal))
(is (equal (cat-7:f-cmpr 3 2) :greater))
(is (equal (cat-7:f-cmpr 123 789) :less))
(is (equal (cat-7:maplexico #'cat-7:f-cmpr '(1 2 3) '(1 3)) :less))... |
721e4bbb97e93196b39f0f036e598d617b0725ecda0852d7875ad6558e68b47d | phoityne/ghci-dap | GhcApiCompat.hs | module GHCi.GhcApiCompat (
module GHC.Runtime.Heap.Inspect
, module GHC.Unit
, module GHC.Driver.Monad
, module GHC.Unit.Module
, module GHC.Utils.Outputable
, module GHC.Utils.Exception
, module GHC.Runtime.Debugger
, module GHC.Data.FastString
, module GHC.Runtime.Eval.Types
, module GHC.Core.Da... | null | https://raw.githubusercontent.com/phoityne/ghci-dap/2d8021503b41ae69f5475c553ab812ce012a05c3/app-ghc-9.4/GHCi/GhcApiCompat.hs | haskell | |
|
| module GHCi.GhcApiCompat (
module GHC.Runtime.Heap.Inspect
, module GHC.Unit
, module GHC.Driver.Monad
, module GHC.Unit.Module
, module GHC.Utils.Outputable
, module GHC.Utils.Exception
, module GHC.Runtime.Debugger
, module GHC.Data.FastString
, module GHC.Runtime.Eval.Types
, module GHC.Core.Da... |
89ce0e9933812c82db8171db161df652ae9c019e5d9bebdc3022c0c0333598ab | kupl/LearnML | original.ml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((exp : aexp), (x : string)) : aexp =
let rec diff_sum (lst : aexp list) : aexp list =
match lst with [] -> [] | hd :: tl -> diff (hd, x) :: diff_sum tl
in
match exp with
| C... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/diff/sub154/original.ml | ocaml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((exp : aexp), (x : string)) : aexp =
let rec diff_sum (lst : aexp list) : aexp list =
match lst with [] -> [] | hd :: tl -> diff (hd, x) :: diff_sum tl
in
match exp with
| C... | |
615201ecb113bc85972ab6784317b0df923e52adf6f5004f1628897ad4a7d4d3 | Incubaid/arakoon | multi_paxos.ml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
distribut... | null | https://raw.githubusercontent.com/Incubaid/arakoon/43a8d0b26e4876ef91d9657149f105c7e57e0cb0/src/paxos/multi_paxos.ml | ocaml | timeout and to_receive, and who got through
still needed, & who voted
conversion since not all code is 'networked'
sleep a little longer than necessary on a slave
to prevent a node thinking it's still the master
while some slaves have elected a new master amongst them
(in case th... |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
distribut... |
54a07c2e2c4321aed99269d8b6cbaf4a9710032a65c4d2fad56598b89577e8bb | wdhowe/clojure-snippets | core.clj | (ns http-get.core
(:require [clojure.tools.cli]
[clj-http.client :as http])
(:gen-class))
(def cli_options
"CLI arguments (clojure.tools.cli)"
[;[short-option long-option description :other options]
["-h" "--help" "Show help" :default false]
["-u" "--url URL" "Address to http/get on" :default... | null | https://raw.githubusercontent.com/wdhowe/clojure-snippets/0c3247ce99a563312b549d03f080b8cf449b541d/http/http_get/src/http_get/core.clj | clojure | [short-option long-option description :other options]
parse command line args
extract the url from the cli args
execute the http/get on the url
show usage when help flag set and exit | (ns http-get.core
(:require [clojure.tools.cli]
[clj-http.client :as http])
(:gen-class))
(def cli_options
"CLI arguments (clojure.tools.cli)"
["-h" "--help" "Show help" :default false]
["-u" "--url URL" "Address to http/get on" :default
""]])
(defn show_usage
"Show the application usage... |
e2a172865932e942bee40fba614919789c9543efa93507e9b72ef72ece30dee5 | aantron/luv | DLL.mli | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
* Dynamic linking .
See { { : } { i Shared library
handling } } in libuv .
See {{:} {i Shared library
handling}} in libuv. *)
type t
* Binds { { : #c.uv_lib_t ... | null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/src/DLL.mli | ocaml | * Loads a symbol from a shared library.
Binds {{:#c.uv_dlsym} [uv_dlsym]}. See
{{:-pages/man3/dlsym.3p.html} [dlsym(3p)]}.
Evaluates to [None] on failure. In that case, call {!Luv.DLL.last_error} to
get the error message.
* Retrieves the last error message from {!Luv.DLL.open_} or {!Luv.DLL.sym}.
... | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
* Dynamic linking .
See { { : } { i Shared library
handling } } in libuv .
See {{:} {i Shared library
handling}} in libuv. *)
type t
* Binds { { : #c.uv_lib_t ... |
f5fc42eece3582835bc2361f420763e4b54aeb565bd1f7da4b39a7d8a4c23857 | danieljharvey/mimsa | Repl.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Test.Modules.Repl
( spec,
)
where
-- testing doing repl things but in the modules world
import Data.Either (isLeft, isRight)
import Data.Functor (($>))
import qualified Data.List.NonEmpty as NE
import Data.Text (Te... | null | https://raw.githubusercontent.com/danieljharvey/mimsa/e6b177dd2c38e8a67d6e27063ca600406b3e6b56/compiler/test/Test/Modules/Repl.hs | haskell | # LANGUAGE OverloadedStrings #
testing doing repl things but in the modules world
remove annotations for comparison
no function equality
need a new way of stopping this looping
perhaps static analysis for silly cases
and a timeout when used as an endpoint?
built-ins should not be used as type constructors
simpl... | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
module Test.Modules.Repl
( spec,
)
where
import Data.Either (isLeft, isRight)
import Data.Functor (($>))
import qualified Data.List.NonEmpty as NE
import Data.Text (Text)
import qualified Data.Text as T
import qualified Language.Mimsa.Actions.Helpers.Parse... |
3d44e8f38a3665bc19d0bd9c88c1327c26adeca93b2c86ab3fb69a1678a5b19e | input-output-hk/cardano-rest | BlockPagesTotal.hs | {-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module Explorer.Web.Api.Legacy.BlockPagesTotal
( blockPagesTotal
) where
import Cardano.Db
( EntityField (..), isJust )
import Control.Monad.IO.Class
( MonadIO )
import Data.Maybe
( listToMaybe )
import Database.Esqueleto
( countRows, f... | null | https://raw.githubusercontent.com/input-output-hk/cardano-rest/040b123b45af06060aae04479d92fada68820f12/explorer-api/src/Explorer/Web/Api/Legacy/BlockPagesTotal.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings # | module Explorer.Web.Api.Legacy.BlockPagesTotal
( blockPagesTotal
) where
import Cardano.Db
( EntityField (..), isJust )
import Control.Monad.IO.Class
( MonadIO )
import Data.Maybe
( listToMaybe )
import Database.Esqueleto
( countRows, from, select, unValue, where_, (^.) )
import Database.Persist.Sq... |
32dbfb3d569524d6cc91dfd3e5df9bcba098ac596f6d1e9420f2d641e582c915 | austral/austral | ExtractionPass.ml |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... | null | https://raw.githubusercontent.com/austral/austral/69b6f7de36cc9576483acd1ac4a31bf52074dbd1/lib/ExtractionPass.ml | ocaml | Find the set of modules we're importing from.
Add the module to the environment.
Extract the list of local type signatures. This lets us parse type
specifiers without reference to the environment.
Extract all declarations from the module into the environment.
* Given the environment, the ID of the module w... |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... |
b1c9639ea6860b6379d95a90a1cce791497b76ce0c2db91fce42ba4ae9fbfcdc | simingwang/emqx-plugin-kafkav5 | tls_record_1_3.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2007 - 2022 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/rel/emqx_plugin_kafka/lib/ssl-10.7/src/tls_record_1_3.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2007 - 2022 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(tls_record_1_3).
-include("tls_record.hrl").
-include("tls_record_1_3.hrl").
-include("ssl_internal.hrl").
... |
dcc3bc48763d8ae5d18d35fe88f48dc1953185e87a56711a59d4fbe7b28bd70c | braintripping/lark | operation.clj | (ns lark.structure.operation)
(defmacro defop [k f]
`(swap! ~'lark.structure.operation/registry assoc ~k ~f)) | null | https://raw.githubusercontent.com/braintripping/lark/95038a823068681c39453c46a309a3514cf48800/tools/test/lark/structure/operation.clj | clojure | (ns lark.structure.operation)
(defmacro defop [k f]
`(swap! ~'lark.structure.operation/registry assoc ~k ~f)) | |
0f8e0c9772e1d143bb98a54fcc5909d61f52b243372702104d370a585afc1937 | dizzyd/erlang-mysql-driver | mysql.erl | %%% coding: latin-1
%%% File : mysql.erl
Author : < >
. : MySQL client .
%%%
Created : 4 Aug 2005 by < >
%%%
Copyright ( c ) 2001 - 2004 Kungliga Tekniska Högskolan
%%% See the file COPYING
%%%
Modified : 9/12/2006 by < >
%%% Note: Added support for prepared statements,
%%% transactions, bett... | null | https://raw.githubusercontent.com/dizzyd/erlang-mysql-driver/051f22e1cbe130061b43273a14217c659e6b860d/src/mysql.erl | erlang | coding: latin-1
File : mysql.erl
See the file COPYING
Note: Added support for prepared statements,
transactions, better connection pooling, more efficient logging
and made other internal enhancements.
moved much of the prepared statement handling code to mysql_conn.erl
and added versioning to prepared st... | Author : < >
. : MySQL client .
Created : 4 Aug 2005 by < >
Copyright ( c ) 2001 - 2004 Kungliga Tekniska Högskolan
Modified : 9/12/2006 by < >
Modified : 9/23/2006 Rewrote the transaction handling code to
provide a simpler , - style transaction interface . Also ,
Call one of the start - ... |
a925dca99735280e2b31f77ef6b887343e1c0eecb21cbd3fcc6c60b2978e7a85 | yangchenyun/learning-sicp | setup.scm | SETUP.SCM
;;;
MIT 6.001 Spring , 2005
PROJECT 4
;;;========================================================================
;;; You can extend this file to extend your world.
;;;========================================================================
;;-----------------------... | null | https://raw.githubusercontent.com/yangchenyun/learning-sicp/99a19a06eddc282e0eb364536e297f27c32a9145/practices/projects/project4/setup.scm | scheme |
========================================================================
You can extend this file to extend your world.
========================================================================
------------------------------------------------------------
------------------------------------------------------------
Cr... | SETUP.SCM
MIT 6.001 Spring , 2005
PROJECT 4
Utils to connect places by way of exits
(define (can-go-both-ways from direction reverse-direction to)
(create-exit from direction to)
(create-exit to reverse-direction from))
(define (create-world)
(let ((10-250 (create-... |
bc47acebc3683153095c18c3f8713b59b899ed7578f11699338434d3b5e03329 | dmitryvk/sbcl-win32-threads | type-vops.lisp | ;;;; type testing and checking VOPs for the PPC VM
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the publ... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/compiler/ppc/type-vops.lisp | lisp | type testing and checking VOPs for the PPC VM
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
Simple type checking and testing:
derive that it can use the sneaky trap
thing at a time...
O... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!VM")
(defun %test-fixnum (value target not-p &key temp)
(assemble ()
(inst andi. temp value fixnum-ta... |
116955c665e9ff591a173f1cad50091764f043938d10a02aa04b9904261aaf9c | ygrek/mldonkey | string2.mli | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/utils/cdk/string2.mli | ocaml | d [replace doc c str] replace all the occurences of the char [c] in
[doc] by the string [str]
d [split str c] split the string [str] in substrings separated by
the character [c]
d [unsplit str c] reverse operation of [split]
d [before s pos] returns the substring of [s] starting at pos 0 and
of length [pos].
d ... | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
... |
08a37f89a9d8fc9c897521fc9ac168192aa480f9a6958f234c34fa2bad8e8b92 | ejgallego/coq-serapi | ser_vmemitcodes.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * INRIA , CNRS and contributors - Copyright 1999 - 2018
(* <O___,, * (see CREDITS file for the list of authors) *)
\VV/ * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/dd9e3fbf7faaf3bf365fa3eff134641055151a9b/serlib/ser_vmemitcodes.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
<O___,, * (see CREDITS file for the list of authors)
// * This file is distributed under the terms of the
* (see LICENSE file for... | v * INRIA , CNRS and contributors - Copyright 1999 - 2018
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser General Public License Version 2.1
Copyright 2016 - 2019 MINES ParisT... |
b7315eb5c2755e0c3627e0ecd697fefa6dbaf0bf3af47748b7f46f70f8c2ad13 | hurryabit/pukeko | NoLambda.hs | # LANGUAGE TemplateHaskell #
module Pukeko.AST.NoLambda
( Name (..)
, Module
, TopLevel (..)
, Expr (..)
, Defn (..)
, Altn (..)
, mkAp
, unzipDefns
, zipMaybe
)
where
import Pukeko.Prelude
import Pukeko.Pretty
import Data.Aeson.TH
newtype Name = MkName{unName :: String}
deriving (Eq, Ord)
dat... | null | https://raw.githubusercontent.com/hurryabit/pukeko/d11a101a41123c5151bcdd7dd2d0ef53c65483c2/src/Pukeko/AST/NoLambda.hs | haskell | maintained invariant | # LANGUAGE TemplateHaskell #
module Pukeko.AST.NoLambda
( Name (..)
, Module
, TopLevel (..)
, Expr (..)
, Defn (..)
, Altn (..)
, mkAp
, unzipDefns
, zipMaybe
)
where
import Pukeko.Prelude
import Pukeko.Pretty
import Data.Aeson.TH
newtype Name = MkName{unName :: String}
deriving (Eq, Ord)
dat... |
e3400caa017b86bfe0ae748024d170a598a6d13e865b3a5ead2e6d677d20e60b | diku-dk/futhark | Tokens.hs | {-# LANGUAGE Strict #-}
-- | Definition of the tokens used in the lexer.
--
-- Also defines other useful building blocks for constructing tokens.
module Language.Futhark.Parser.Lexer.Tokens
( Token (..),
Lexeme,
fromRoman,
symbol,
mkQualId,
tokenPosM,
tokenM,
tokenC,
keyword,
toke... | null | https://raw.githubusercontent.com/diku-dk/futhark/6f991b0c17660bdfde457c2e052e7a3160996606/src/Language/Futhark/Parser/Lexer/Tokens.hs | haskell | # LANGUAGE Strict #
| Definition of the tokens used in the lexer.
Also defines other useful building blocks for constructing tokens.
| A lexical token. It does not itself contain position
information, so in practice the parser will consume tokens tagged
with a source position.
A left bracket immediately followi... |
module Language.Futhark.Parser.Lexer.Tokens
( Token (..),
Lexeme,
fromRoman,
symbol,
mkQualId,
tokenPosM,
tokenM,
tokenC,
keyword,
tokenS,
indexing,
suffZero,
tryRead,
readIntegral,
readHexRealLit,
)
where
import Data.ByteString.Lazy qualified as BS
import D... |
d969d582371911aa536888f38f2dec3e78a5f78631c9a34bc6755848eebe866d | derekmcloughlin/pearls | chap12b.hs | import Data.Array
testData :: [Int]
testData = [51, 38, 29, 51, 63, 38]
ranking1 :: [Int]
ranking1 = [3, 1, 3, 0, 1]
ranking2 :: [Int]
ranking2 = [2, 0, 3, 4, 0]
tails :: [a] -> [[a]]
tails [] = []
tails xs = xs : tails (tail xs)
rank :: Ord a => [a] -> [Int]
rank xs = map (\x -> length (filter (< x) xs)) xs
-- ... | null | https://raw.githubusercontent.com/derekmcloughlin/pearls/42bc6ea0fecc105386a8b75789f563d44e05b772/chap12/chap12b.hs | haskell | This function isn't actually used in the algorithm. | import Data.Array
testData :: [Int]
testData = [51, 38, 29, 51, 63, 38]
ranking1 :: [Int]
ranking1 = [3, 1, 3, 0, 1]
ranking2 :: [Int]
ranking2 = [2, 0, 3, 4, 0]
tails :: [a] -> [[a]]
tails [] = []
tails xs = xs : tails (tail xs)
rank :: Ord a => [a] -> [Int]
rank xs = map (\x -> length (filter (< x) xs)) xs
rat... |
158417b07cc95e1479cbf282128659146f6613376248350c05e66f83ef0fb202 | functionally/mantis-oracle | Reader.hs | -----------------------------------------------------------------------------
--
-- Module : $Headers
Copyright : ( c ) 2021
License : MIT
--
Maintainer : < >
-- Stability : Experimental
Portability : Portable
--
-- | Example validator to read the oracle.
--
-------------------... | null | https://raw.githubusercontent.com/functionally/mantis-oracle/6fd5bc966f7c2506460395ef66a77f59ea6fc01f/src/Mantra/Oracle/Reader.hs | haskell | ---------------------------------------------------------------------------
Module : $Headers
Stability : Experimental
| Example validator to read the oracle.
---------------------------------------------------------------------------
# LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #... | Copyright : ( c ) 2021
License : MIT
Maintainer : < >
Portability : Portable
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
module Mantra.Oracle.Re... |
4db75e7094fbfc7eb4a79c3435dd292b30f18b2aeda2435dfd5f5b2dfc85af77 | clj-python/libpython-clj | python_test.clj | (ns libpython-clj2.python-test
(:require [libpython-clj2.python :as py :refer [py. py.. py.- py* py**]]
;;support for tensor/numpy integration
[libpython-clj2.python.np-array]
[libpython-clj2.python.ffi :as py-ffi]
[tech.v3.datatype :as dtype]
[tech.v3.datat... | null | https://raw.githubusercontent.com/clj-python/libpython-clj/73857422d12ce646c1167be0e84e807b5919c40c/test/libpython_clj2/python_test.clj | clojure | support for tensor/numpy integration
Useful to see how many times we convert a string to a python object.
(dt-ffi/enable-string->c-stats!)
(.addShutdownHook (Runtime/getRuntime) (Thread.
(fn []
(clojure.pprint/pprint
... | (ns libpython-clj2.python-test
(:require [libpython-clj2.python :as py :refer [py. py.. py.- py* py**]]
[libpython-clj2.python.np-array]
[libpython-clj2.python.ffi :as py-ffi]
[tech.v3.datatype :as dtype]
[tech.v3.datatype.functional :as dfn]
[tech.v3.dataty... |
fb74089b2eadb7e937ec4d662007813383e058a59149efe64deb852854e8746c | triffon/fp-2022-23 | 04-preferred-network.rkt | #lang racket
Обхват на мрежа наричаме множеството от поддържаните от тях
честотни ленти .
Казваме , че съвместимо мрежа ,
ако имат поне две общи честотни ленти .
(define (intersection lst1 lst2)
(filter (lambda (x) (member x lst2)) lst1))
(define (compatible? mobile-device mobile-networ... | null | https://raw.githubusercontent.com/triffon/fp-2022-23/fb8549ecabc1a792442783b48dca7d294e8e2996/exercises/inf2/exams/01-exam/exam-2022-2023/a/04-preferred-network.rkt | racket | ; = > ( 1 3 7 ) | #lang racket
Обхват на мрежа наричаме множеството от поддържаните от тях
честотни ленти .
Казваме , че съвместимо мрежа ,
ако имат поне две общи честотни ленти .
(define (intersection lst1 lst2)
(filter (lambda (x) (member x lst2)) lst1))
(define (compatible? mobile-device mobile-networ... |
94718f5480ce4d92405e39c0c5c54b86d620f8e644b8069236a6a025fc60fcf4 | ucsd-progsys/nate | dumpobj.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/tools/dumpobj.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : dumpobj.ml , v 1.37 2006/05/1... |
72fccd949f77e03c0be83feaabf9b29d76e072d9b9b478b1875206b1b29af180 | B-Lang-org/bsc | GenWrap.hs | # LANGUAGE CPP #
{-# OPTIONS_GHC -fwarn-name-shadowing #-}
module GenWrap(
genWrap,
WrapInfo(..)
) where
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 804)
import Prelude hiding ((<>))
#endif
import Data.List(nub, (\\), find)
import ErrorTCompat
import Control... | null | https://raw.githubusercontent.com/B-Lang-org/bsc/38674d719e6372a84fa1ca15986701b206073f7c/src/comp/GenWrap.hs | haskell | # OPTIONS_GHC -fwarn-name-shadowing #
====================
don't expect it to fail
get the state as well,
and we don't expect it to fail
for converting from ErrorMonad
====================
Yes fields can be other interfaces
a list of any user-provided names (empty if no names)
====================
module name... | # LANGUAGE CPP #
module GenWrap(
genWrap,
WrapInfo(..)
) where
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 804)
import Prelude hiding ((<>))
#endif
import Data.List(nub, (\\), find)
import ErrorTCompat
import Control.Monad.State
import PFPrint
import Positio... |
d89e0203a62d96e62f8d51aabb8b4a0d3abee2301d474c9280a12cc748f9644b | frenetic-lang/netkat | NetKAT_Semantics.ml | module type S = sig
type pkt
type pol
module PktSet : Set.S with type elt = pkt
val eval : pkt -> pol -> PktSet.t
end
module Make (Syntax : NetKAT_Syntax.S) = struct
type pkt = Syntax.pkt
type pol = Syntax.pol
open Syntax
module PktSet = Set.Make (struct
type t = pkt
(* First compar... | null | https://raw.githubusercontent.com/frenetic-lang/netkat/aeac414fc2e2f4c35e9dde07cd9d98f369157265/lib/NetKAT_Semantics.ml | ocaml | First compare by headers, then payload. The payload comparison is a
little questionable. However, this is safe to use in eval, since
all output packets have the same payload as the input packet.
for consistency with Test | module type S = sig
type pkt
type pol
module PktSet : Set.S with type elt = pkt
val eval : pkt -> pol -> PktSet.t
end
module Make (Syntax : NetKAT_Syntax.S) = struct
type pkt = Syntax.pkt
type pol = Syntax.pol
open Syntax
module PktSet = Set.Make (struct
type t = pkt
let compare x y... |
a1e07059baf7e71d42d24df9916c6fffc5839ef386ed902006db8d43080ffce5 | cram2/cram | ode-struct.lisp | ;; Define the structure for ODEs
2009 - 06 - 06 16:42:29EDT ode-struct.lisp
Time - stamp : < 2012 - 01 - 13 12:01:24EST ode-struct.lisp >
;;
Copyright 2006 , 2007 , 2008 , 2009 , 2010
Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it ... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/ordinary-differential-equations/ode-struct.lisp | lisp | Define the structure for ODEs
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program 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 PURPO... | 2009 - 06 - 06 16:42:29EDT ode-struct.lisp
Time - stamp : < 2012 - 01 - 13 12:01:24EST ode-struct.lisp >
Copyright 2006 , 2007 , 2008 , 2009 , 2010
Distributed under the terms of the GNU General Public License
it under the terms of the GNU General Public License as published by
the Free Software Founda... |
1c59a37daebba7e0da6205516ac88a8cac1fa2374833c4547fde1b8e3301ead8 | janestreet/merlin-jst | shape.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/980b574405617fa0dfb0b79a84a66536b46cd71b/src/ocaml/typing/shape.ml | ocaml | ************************************************************************
OCaml
... | , , Tarides
Copyright 2021 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
module Uid = struct
type t =
| Compilation_unit of string
| Item of { comp_unit: string; id: int }
| In... |
7c30d33f0403ad1974fcd5063199b024c246104f0ce9bd14c73273826e449515 | 2600hz-archive/whistle | whistle_couch.erl | -module(whistle_couch).
-behaviour(application).
-author('James Aimonetti <>').
-export([start/2, start/0, start_link/0, stop/0, stop/1]).
%%
start(_Type, _Args) ->
start_deps(),
whistle_couch_sup:start_link().
( ) - > { ok , Pid::pid ( ) }
%% @doc Starts the app for inclusion in a supervisor tree
start... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/whistle_couch-1.0.0/src/whistle_couch.erl | erlang |
@doc Starts the app for inclusion in a supervisor tree
@doc Start the couch server.
@doc Stop the couch server. | -module(whistle_couch).
-behaviour(application).
-author('James Aimonetti <>').
-export([start/2, start/0, start_link/0, stop/0, stop/1]).
start(_Type, _Args) ->
start_deps(),
whistle_couch_sup:start_link().
( ) - > { ok , Pid::pid ( ) }
start_link() ->
start_deps(),
whistle_couch_sup:start_link... |
519f966fedea6c1417c043f656b3b065e16cbb91b5159bd2501c05197b8a40d9 | pkaleta/kivi | LetTransformer.hs | module LetTransformer where
import ParserTypes
import Common
import List
import NameSupply
import AbstractDataTypes
import Debug.Trace
transformLet :: [DataType] -> Expr Pattern -> Expr Pattern
transformLet adts expr = expr'
where
(ns', expr') = transformLet' initialNameSupply adts expr
transformLet' ... | null | https://raw.githubusercontent.com/pkaleta/kivi/95d9a7c8023598c3ed634b9a7dbecaee3c6478fe/LetTransformer.hs | haskell | pattern it means that pattern is refutable | module LetTransformer where
import ParserTypes
import Common
import List
import NameSupply
import AbstractDataTypes
import Debug.Trace
transformLet :: [DataType] -> Expr Pattern -> Expr Pattern
transformLet adts expr = expr'
where
(ns', expr') = transformLet' initialNameSupply adts expr
transformLet' ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.