repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
tumsgis/veganmentor
src/main/scala/MongoDb.scala
import DataStructure.{Mentee, Mentor, Participant} import MongoDb.MongoFactory import com.mongodb.casbah.Imports.{ObjectId, _} import com.mongodb.casbah.{Imports, MongoCollection, MongoConnection} object MongoDb { sealed trait MongoDbParticipant { val id: ObjectId val participant: Participant } case cl...
tumsgis/veganmentor
src/test/scala/TestUtil.scala
object TestUtil { def noEmptySlotsBelowZero: Boolean = !MongoDbRepo.getAllMentors.exists(_.emptySlots < 0) }
tumsgis/veganmentor
src/main/scala/JsonMapping.scala
<reponame>tumsgis/veganmentor import DataStructure.{Mentee, Mentor} import net.liftweb.json.JsonAST._ import net.liftweb.json.JsonDSL._ object JsonMapping { implicit val formats = net.liftweb.json.DefaultFormats def printMentor(mentor: Mentor): Unit = { val json = "mentor" -> ("timestamp" -> mentor.tim...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/TweetEntities.scala
package com.danielasfregola.twitter4s.entities.v2 final case class TweetEntities(annotations: Seq[TweetEntitiesAnnotation], urls: Seq[TweetEntitiesURL], hashtags: Seq[TweetEntitiesHashtag], mentions: Seq[TweetEntitiesMention],...
harrywada/twitter4s
src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/tweets/TwitterTweetLookupClientSpec.scala
<reponame>harrywada/twitter4s package com.danielasfregola.twitter4s.http.clients.rest.v2.tweets import akka.http.scaladsl.model.HttpMethods import com.danielasfregola.twitter4s.entities.RatedData import com.danielasfregola.twitter4s.entities.v2.responses.{TweetResponse, TweetsResponse} import com.danielasfregola.twitt...
harrywada/twitter4s
src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/users/fixtures/user_lookup/UsersResponseFixture.scala
<reponame>harrywada/twitter4s package com.danielasfregola.twitter4s.http.clients.rest.v2.users.fixtures.user_lookup import com.danielasfregola.twitter4s.entities.v2._ import com.danielasfregola.twitter4s.entities.v2.responses.UsersResponse import java.time.Instant object UsersResponseFixture { val fixture: UsersRes...
harrywada/twitter4s
src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/utils/V2SpecQueryHelper.scala
package com.danielasfregola.twitter4s.http.clients.rest.v2.utils import com.danielasfregola.twitter4s.entities.v2.enums.expansions.TweetExpansions import com.danielasfregola.twitter4s.entities.v2.enums.expansions.TweetExpansions.{Expansions => TweetExpansions} import com.danielasfregola.twitter4s.entities.v2.enums.exp...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/Error.scala
<reponame>harrywada/twitter4s package com.danielasfregola.twitter4s.entities.v2 final case class Error(detail: String, field: Option[String], parameter: String, resource_id: String, resource_type: String, ...
harrywada/twitter4s
src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/users/TwitterUserLookupClientSpec.scala
package com.danielasfregola.twitter4s.http.clients.rest.v2.users import akka.http.scaladsl.model.HttpMethods import com.danielasfregola.twitter4s.entities.RatedData import com.danielasfregola.twitter4s.entities.v2.enums.expansions.UserExpansions.{Expansions => UserExpansions} import com.danielasfregola.twitter4s.entit...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/Withheld.scala
package com.danielasfregola.twitter4s.entities.v2 import com.danielasfregola.twitter4s.entities.v2.enums.WithheldScope.WithheldScope final case class Withheld(copyright: Boolean, country_codes: Seq[String], scope: WithheldScope)
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/tweets/TwitterTimelinesClient.scala
package com.danielasfregola.twitter4s.http.clients.rest.v2.tweets import com.danielasfregola.twitter4s.entities.RatedData import com.danielasfregola.twitter4s.entities.v2.enums.expansions.TweetExpansions.Expansions import com.danielasfregola.twitter4s.entities.v2.enums.fields.MediaFields.MediaFields import com.daniela...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/responses/UserResponse.scala
<reponame>harrywada/twitter4s<gh_stars>0 package com.danielasfregola.twitter4s.entities.v2.responses import com.danielasfregola.twitter4s.entities.v2.{Error, UserIncludes, User} case class UserResponse(data: Option[User], includes: Option[UserIncludes], errors: Seq[Erro...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/UserEntities.scala
<reponame>harrywada/twitter4s package com.danielasfregola.twitter4s.entities.v2 final case class UserEntities(url: Option[UserURLContainer], description: Option[UserEntitiesDescription]) final case class UserURLContainer(urls: Seq[UserEntitiesURL]) final case class UserEntitiesURL(start...
harrywada/twitter4s
src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/tweets/fixtures/timelines/TweetsResponseFixture.scala
<gh_stars>0 package com.danielasfregola.twitter4s.http.clients.rest.v2.tweets.fixtures.timelines import com.danielasfregola.twitter4s.entities.v2._ import com.danielasfregola.twitter4s.entities.v2.enums.{CoordinatesType, ReferencedTweetType, TweetReplySetting} import com.danielasfregola.twitter4s.entities.v2.responses...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/responses/TweetResponse.scala
package com.danielasfregola.twitter4s.entities.v2.responses import com.danielasfregola.twitter4s.entities.v2.{Error, TweetIncludes, Tweet} final case class TweetResponse(data: Option[Tweet], includes: Option[TweetIncludes], errors: Seq[Error])
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/User.scala
package com.danielasfregola.twitter4s.entities.v2 import java.time.Instant final case class User(id: String, name: String, username: String, created_at: Option[Instant], `protected`: Option[Boolean], withheld...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/users/parameters/UsersByUsernamesParameters.scala
package com.danielasfregola.twitter4s.http.clients.rest.v2.users.parameters import com.danielasfregola.twitter4s.entities.v2.enums.expansions.UserExpansions.Expansions import com.danielasfregola.twitter4s.entities.v2.enums.fields.TweetFields.TweetFields import com.danielasfregola.twitter4s.entities.v2.enums.fields.Use...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/enums/expansions/TweetExpansions.scala
<filename>src/main/scala/com/danielasfregola/twitter4s/entities/v2/enums/expansions/TweetExpansions.scala package com.danielasfregola.twitter4s.entities.v2.enums.expansions object TweetExpansions extends Enumeration { type Expansions = Value // val `Attachments.PollIds` = Value("attachments.poll_ids") // TODO: Pe...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/UserIncludes.scala
<gh_stars>0 package com.danielasfregola.twitter4s.entities.v2 case class UserIncludes(tweets: Seq[Tweet], users: Seq[User])
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/enums/expansions/UserExpansions.scala
<reponame>harrywada/twitter4s package com.danielasfregola.twitter4s.entities.v2.enums.expansions object UserExpansions extends Enumeration { type Expansions = Value val PinnedTweetId = Value("pinned_tweet_id") }
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/entities/v2/TweetIncludes.scala
package com.danielasfregola.twitter4s.entities.v2 final case class TweetIncludes(tweets: Seq[Tweet], users: Seq[User] // places: Seq[Place], // TODO: Pending addition of places model // media: Seq[Media], // TODO: Pending addi...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/TwitterRestV2Client.scala
package com.danielasfregola.twitter4s import akka.actor.ActorSystem import com.danielasfregola.twitter4s.entities.{AccessToken, ConsumerToken} import com.danielasfregola.twitter4s.http.clients.rest.RestClient import com.danielasfregola.twitter4s.http.clients.rest.v2.tweets.{TwitterTimelinesClient, TwitterTweetLookupCl...
harrywada/twitter4s
src/main/scala/com/danielasfregola/twitter4s/http/serializers/EnumFormats.scala
<reponame>harrywada/twitter4s<gh_stars>1-10 package com.danielasfregola.twitter4s.http.serializers import com.danielasfregola.twitter4s.entities.enums._ import com.danielasfregola.twitter4s.entities.v2.enums._ import org.json4s.Formats import org.json4s.ext.EnumNameSerializer private[twitter4s] object EnumFormats exte...
harrywada/twitter4s
src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/v2/tweets/TwitterTimelinesClientSpec.scala
<reponame>harrywada/twitter4s package com.danielasfregola.twitter4s.http.clients.rest.v2.tweets import akka.http.scaladsl.model.HttpMethods import com.danielasfregola.twitter4s.entities.RatedData import com.danielasfregola.twitter4s.entities.v2.enums.expansions.TweetExpansions.{Expansions => TweetExpansions} import co...
sam-ma/hawtdispatch
hawtdispatch-scala/src/test/scala/org/fusesource/hawtdispatch/SocketTest.scala
<reponame>sam-ma/hawtdispatch /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 * * http://www.apache.org/licenses/L...
sam-ma/hawtdispatch
hawtdispatch-example/src/main/scala/org/fusesource/hawtdispatch/example/UdpEchoServer.scala
/** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requir...
sam-ma/hawtdispatch
hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch/ListEventAggregator.scala
<filename>hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch/ListEventAggregator.scala /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtai...
sam-ma/hawtdispatch
hawtdispatch-example/src/main/scala/org/fusesource/hawtdispatch/example/CustomDispatchSourceScala.scala
/** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requir...
sam-ma/hawtdispatch
hawtdispatch-example/src/main/scala/org/fusesource/hawtdispatch/example/EchoServer.scala
<reponame>sam-ma/hawtdispatch<filename>hawtdispatch-example/src/main/scala/org/fusesource/hawtdispatch/example/EchoServer.scala /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with...
sam-ma/hawtdispatch
hawtdispatch-website/ext/Website.scala
<reponame>sam-ma/hawtdispatch /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2...
sam-ma/hawtdispatch
hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch/ScalaDispatchHelpers.scala
<gh_stars>10-100 /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 *...
sam-ma/hawtdispatch
hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch.scala
<gh_stars>10-100 /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 *...
sam-ma/hawtdispatch
hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch/TaskTracker.scala
<reponame>sam-ma/hawtdispatch /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 * * http://www.apache.org/licenses/L...
sam-ma/hawtdispatch
hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch/Future.scala
<filename>hawtdispatch-scala/src/main/scala/org/fusesource/hawtdispatch/Future.scala /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * 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 t...
sam-ma/hawtdispatch
hawtdispatch-example/src/main/scala/org/fusesource/hawtdispatch/example/discovery/EchoNetScala.scala
<filename>hawtdispatch-example/src/main/scala/org/fusesource/hawtdispatch/example/discovery/EchoNetScala.scala /** * Copyright (C) 2012 FuseSource, Inc. * http://fusesource.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * ...
tanbozensen/api
app/services/TanboService.scala
<filename>app/services/TanboService.scala package services import models.Tanbo import play.api.Play.current import play.api.db.slick.Config.driver.simple._ import play.api.db.slick.DB import models.TanboDAO object TanboService { /** * 田んぼ情報の作成 */ def create (tanbo : Tanbo) : Option[Tanbo] = { DB.with...
tanbozensen/api
app/constants/PHASE.scala
<gh_stars>1-10 package constants object PHASE { // objectで定義するとsingletonになる case object TAUE extends PHASE(0) case object INEKARI extends PHASE(1) private val codeTable = Array(TAUE, INEKARI) def complement(code:Int) : PHASE = codeTable((~code & 0x03) | (code & 0x04)) } // sealedを付けると、DNAを拡張したクラスはこのファイル内でし...
tanbozensen/api
app/constants/RICE_TYPE.scala
<reponame>tanbozensen/api<filename>app/constants/RICE_TYPE.scala package constants object RICE_TYPE { // objectで定義するとsingletonになる case object SASANISHIKI extends RICE_TYPE(0) case object KOSHIHIKARI extends RICE_TYPE(1) private val codeTable = Array(SASANISHIKI, KOSHIHIKARI) def complement(code:Int) : RICE...
tanbozensen/api
app/controllers/TanboController.scala
<gh_stars>1-10 package controllers import models.Tanbo import play.api.libs.json.JsError import play.api.libs.json.Json import play.api.libs.json.Json.toJsFieldJsValueWrapper import play.api.mvc.Action import play.api.mvc.Controller import models.TanboDAO import services.TanboService import com.github.tototoshi.play.j...
tanbozensen/api
app/models/Tanbo.scala
<gh_stars>1-10 package models import play.api.Play.current import play.api.db.slick.Config.driver.simple._ import play.api.db.slick._ /** * 田んぼ情報クラス */ case class Tanbo( id: Option[Long], riceType: Option[Int], phase: Int, doneDate: String, latitude: Double, longitude: Double, areaUnderTillage: Option...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/clusteringKMeans/Clustering.scala
package clusteringKMeans import java.io.FileNotFoundException import scala.collection.JavaConverters.seqAsJavaListConverter import scala.collection.mutable.MultiMap import scala.util.Random import org.apache.spark.SparkContext.doubleRDDToDoubleRDDFunctions import org.apache.spark.SparkContext.rddToPairRDDFunctions imp...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/util/CCUtil.scala
package util import org.apache.spark.SparkContext._ import org.apache.spark.rdd.RDD import scala.collection.mutable.ListBuffer import org.apache.spark.SparkContext import org.apache.spark.SparkConf import scala.io.Source import org.apache.spark.api.java.JavaSparkContext import com.google.common.base.Joiner import java...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/crackerAllComparable/CrackerMessagePropagation.scala
<gh_stars>1-10 package crackerAllComparable @serializable class CrackerTreeMessagePropagation [T <: Comparable[T]](val min : Option[T], val child : Set[T]) extends CrackerMessageSize { def getMessageSize = child.size + 1 }
alessandrolulli/knnMeetsConnectedComponents
src/main/java/crackerAllComparable/CrackerAllComparable.scala
<filename>src/main/java/crackerAllComparable/CrackerAllComparable.scala package crackerAllComparable import scala.Array.canBuildFrom import org.apache.spark.SparkContext import org.apache.spark.SparkContext.rddToPairRDDFunctions import org.apache.spark.rdd.RDD import util.CCProperties import util.CCUtil import util.CC...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/util/CCPropertiesImmutable.scala
<gh_stars>1-10 package util @serializable class CCPropertiesImmutable(algorithmNameFromConfig : String, val datasetKNN : String, val datasetCC : String, val outputFile : String, val jarPath : String, val sparkMaster : String, val sparkPartition : Int, val sparkExecut...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/crackerAllComparable/CrackerAlgorithm.scala
package crackerAllComparable import org.apache.spark.SparkContext._ import scala.collection.mutable.ListBuffer import org.apache.spark.rdd.RDD import org.apache.spark.SparkContext import java.io.FileWriter import util.CCPropertiesImmutable @serializable class CrackerAlgorithm[T <: Comparable[T]](property : CCProperti...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/info/debatty/spark/nndescent/NNDescentMainScala.scala
package info.debatty.spark.nndescent import util.CCPropertiesImmutable import org.apache.spark.api.java.JavaSparkContext import util.CCUtil import org.apache.spark.rdd.RDD import util.CCProperties import info.debatty.java.graphs.Node import info.debatty.java.stringsimilarity.JaroWinkler import org.apache.spark.api.jav...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/util/CCUtilIO.scala
<filename>src/main/java/util/CCUtilIO.scala<gh_stars>1-10 package util import java.io.FileWriter import java.text.DecimalFormat import org.apache.spark.SparkContext._ import org.apache.spark.SparkContext import org.apache.spark.rdd.RDD import com.google.common.base.Joiner class CCUtilIO(property : CCPropertiesImmut...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/crackerAllComparable/CrackerMessageIdentification.scala
package crackerAllComparable @serializable class CrackerTreeMessageIdentification[T <: Comparable[T]] (val min: T, val neigh: Set[T]) extends CrackerMessageSize { def voteToHalt = neigh.isEmpty def getMessageSize = neigh.size + 1 def merge(other : Option[CrackerTreeMessageIdentification[T]]) : Option[CrackerTre...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/crackerAllComparable/CrackerMessageRedPhase.scala
package crackerAllComparable @serializable class CrackerTreeMessageRedPhase [T <: Comparable[T]](val first : Option[CrackerTreeMessageIdentification[T]], val second : Option[CrackerTreeMessageTree[T]]) extends CrackerMessageSize { def getMessageSize = 0//first.getOrElse(CrackerTreeMessageIdentification.empty).getMess...
alessandrolulli/knnMeetsConnectedComponents
src/main/java/crackerAllComparable/CrackerMessageTree.scala
package crackerAllComparable @serializable class CrackerTreeMessageTree[T <: Comparable[T]] (val parent : Option[T], val child : Set[T]) extends CrackerMessageSize { def getMessageSize = child.size + 1 def merge(other : Option[CrackerTreeMessageTree[T]]) : Option[CrackerTreeMessageTree[T]] = { if(other.isDefine...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/tuple/CanFromLiterals.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.tuple import shapeless.{::, HList} trait CanFromLiterals extends CanCons { _self: TupleSystem => object FromLiterals extends AbstractFromHList { implicit def inductive[ H_TAIL <: HList, TAIL <: Tuple, HEAD <: UpperBound wi...
ithinkicancode/shapesafe
macro/src/main/scala/org/shapesafe/m/FieldTypes.scala
package org.shapesafe.m import shapeless.ops.hlist.Mapper import shapeless.{Generic, HList, Poly1, Typeable} import scala.language.experimental.macros import scala.reflect.macros.whitebox trait FieldTypes[A <: Product] { type Out <: HList } object FieldTypes { case class Impl[A <: Product, O <: HList]() extends...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/ProveArity.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.arity import org.shapesafe.core.ProofSystem /** * Represents a reified Arity */ object ProveArity extends ProofSystem[Arity] {}
ithinkicancode/shapesafe
core/src/test/scala/org/shapesafe/core/util/RecordViewSpec.scala
<filename>core/src/test/scala/org/shapesafe/core/util/RecordViewSpec.scala package org.shapesafe.core.util; import org.shapesafe.BaseSpec import shapeless.HNil; class RecordViewSpec extends BaseSpec { import shapeless.syntax.singleton._ val record = ("a" ->> 1) :: ("b" ->> "x") :: HNil val view = Reco...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/LeafArity.scala
<gh_stars>1-10 package org.shapesafe.core.arity import scala.language.implicitConversions /** * Irreducible */ trait LeafArity extends VerifiedArity {} object LeafArity {}
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/Poly1Base.scala
<gh_stars>1-10 package org.shapesafe.core import shapeless.Poly1 import scala.annotation.implicitNotFound // TODO: compiler bug? // https://stackoverflow.com/questions/65944627/in-scala-how-could-a-covariant-type-parameter-be-an-upper-bound-of-an-abstract // TODO: merge into shapeless Poly1 trait Poly1Base[IUB, OUB...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/unary/ReduceByName.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.shape.unary import org.shapesafe.graph.commons.util.HasOuter import org.shapesafe.core.axis.Axis.UB_->> import org.shapesafe.core.axis.RecordUpdater import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{DebugSymbol, Expre...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/tuple/TupleSystem.scala
<gh_stars>1-10 package org.shapesafe.core.tuple import org.shapesafe.core.Poly1Base import shapeless.{HList, HNil} trait TupleSystem { type UpperBound type Tuple type Eye <: Tuple def Eye: Eye // type ><[ // TAIL <: Impl, // HEAD <: UpperBound // ] <: Impl trait AbstractFromHList extends Po...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/binary/Op2Like.scala
package org.shapesafe.core.arity.binary import org.shapesafe.graph.commons.util.HasOuter import org.shapesafe.core.arity.{Arity, ArityAPI, ArityConjecture} import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{DebugSymbol, OpStrs} trait Op2Like extends Op2Like.DebuggingSupport { ...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/debugging/CanPeek.scala
<reponame>ithinkicancode/shapesafe<gh_stars>1-10 package org.shapesafe.core.debugging trait CanPeek { type _AsOpStr // use singleton-ops type _AsExpr // use TypeVizCT macro }
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/args/ApplyArgs.scala
package org.shapesafe.core.shape.args import org.shapesafe.core.Poly1Base import org.shapesafe.core.shape.Names import shapeless.HList trait ApplyArgs { type OUB val fromHList: Poly1Base[HList, OUB] type Result[T <: OUB] def toResult[T <: OUB](v: T): Result[T] } object ApplyArgs { trait Direct extends A...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/Names.scala
<filename>core/src/main/scala/org/shapesafe/core/shape/Names.scala package org.shapesafe.core.shape import org.shapesafe.core.debugging.CanPeek import org.shapesafe.core.shape.args.ApplyLiterals import org.shapesafe.core.tuple._ import shapeless.Witness import scala.language.implicitConversions trait Names extends I...
ithinkicancode/shapesafe
macro/src/test/scala/org/shapesafe/m/viz/KindVizCTSpec.scala
<filename>macro/src/test/scala/org/shapesafe/m/viz/KindVizCTSpec.scala package org.shapesafe.m.viz import org.shapesafe.graph.commons.testlib.BaseSpec import org.shapesafe.graph.commons.util.reflect.Reflection import org.shapesafe.graph.commons.util.reflect.format.FormatProtos.{DeAlias, Hide} import org.shapesafe.grap...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/debugging/Expressions.scala
<reponame>ithinkicancode/shapesafe<filename>core/src/main/scala/org/shapesafe/core/debugging/Expressions.scala package org.shapesafe.core.debugging object Expressions extends Expressions_Imp0 { trait +[A, B] extends DebugSymbol { type _AsOpStr = " + " } trait -[A, B] extends DebugSymbol { type _AsOpStr ...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/binary/Op2.scala
<reponame>ithinkicancode/shapesafe<filename>core/src/main/scala/org/shapesafe/core/arity/binary/Op2.scala package org.shapesafe.core.arity.binary import org.shapesafe.core.arity.Const import org.shapesafe.core.arity.ProveArity.|-< import org.shapesafe.core.arity.Utils.Op import org.shapesafe.core.arity._ import org.sh...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/binary/Require2.scala
package org.shapesafe.core.arity.binary import org.shapesafe.core.arity.Const import org.shapesafe.core.arity.ProveArity.|-< import org.shapesafe.core.arity.Utils.Op import org.shapesafe.core.arity.{Arity, ArityAPI, ProveArity, Utils} import org.shapesafe.core.debugging.Reporters.ForArity import org.shapesafe.core.deb...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/binary/OuterProduct.scala
package org.shapesafe.core.shape.binary import org.shapesafe.core.axis.Axis import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{Expressions, OpStrs} import org.shapesafe.core.shape.LeafShape.>< import org.shapesafe.core.shape.ProveShape._ import org.shapesafe.core.shape.{LeafShape...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/ShapeAPI.scala
package org.shapesafe.core.shape import org.shapesafe.core.arity.ops.ArityOps import org.shapesafe.core.arity.{Arity, Const, LeafArity} import org.shapesafe.core.shape.LeafShape.><^ import org.shapesafe.core.shape.ProveShape.|- import org.shapesafe.core.shape.binary.OuterProduct import org.shapesafe.core.shape.ops.{Ei...
ithinkicancode/shapesafe
macro/src/main/scala/org/shapesafe/m/viz/ExpressionVizCT.scala
<filename>macro/src/main/scala/org/shapesafe/m/viz/ExpressionVizCT.scala package org.shapesafe.m.viz import org.shapesafe.graph.commons.util.reflect.format.{FormatOvrd, FormatProtos, Formats} import org.shapesafe.graph.commons.util.viz.TypeVizFormat import scala.language.experimental.macros case object ExpressionViz...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/unary/|<<-.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.shape.unary import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{DebugUtil, Expressions, OpStrs, Reporters} import org.shapesafe.core.shape.ProveShape._ import org.shapesafe.core.shape.{LeafShape, Names, Shape} import or...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/Indices.scala
package org.shapesafe.core.shape import org.shapesafe.core.tuple.{CanInfix_><, StaticTuples, TupleSystem} import scala.language.implicitConversions trait Indices extends IndicesMagnet with Indices.proto.Tuple { final override type AsIndices = this.type final override def asIndices: Indices.this.type = this } ...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/debugging/DebugSymbol.scala
package org.shapesafe.core.debugging trait DebugSymbol { type _AsOpStr } object DebugSymbol { trait On1 extends DebugSymbol { trait On[A] {} } trait On2 extends DebugSymbol { trait On[A, B] {} } trait Require extends DebugSymbol { type Complement <: Require // implicitly[this.type <:<...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/ProofSystem.scala
<reponame>ithinkicancode/shapesafe<gh_stars>1-10 package org.shapesafe.core import scala.language.implicitConversions /** * This trait forms the backbone of compile-time reasoning and should reflect our best effort in reproducing * Curry-Howard isomorphism with scala compiler (regardless of how ill-suited it is),...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/APISystem.scala
package org.shapesafe.core import scala.language.implicitConversions /** * A class of which each instance contains an inner dependent type and an instance of such type, generally used for: * * - functions where generic type parameters are impossible or too verbose to define * (e.g. the native implicit scope o...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/ProveShape.scala
package org.shapesafe.core.shape import org.shapesafe.core.ProofSystem object ProveShape extends ProofSystem[Shape] {}
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/unary/GetSubscript.scala
<reponame>ithinkicancode/shapesafe<filename>core/src/main/scala/org/shapesafe/core/shape/unary/GetSubscript.scala package org.shapesafe.core.shape.unary import org.shapesafe.core.Poly1Base import org.shapesafe.core.arity.Arity import org.shapesafe.core.axis.Axis import org.shapesafe.core.axis.Axis.:<<- import org.shap...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/args/ApplyNats.scala
<filename>core/src/main/scala/org/shapesafe/core/shape/args/ApplyNats.scala package org.shapesafe.core.shape.args import org.shapesafe.core.shape.LeafShape import org.shapesafe.core.shape.ShapeAPI.^ import shapeless.ops.hlist.Reverse import shapeless.{HList, NatProductArgs} trait ApplyNats extends ApplyArgs with NatP...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/debugging/Reporters.scala
package org.shapesafe.core.debugging import org.shapesafe.core.debugging.DebugUtil.{CanRefute, Refute, Stripe} import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.OpStrs.OpStr import org.shapesafe.core.{Poly1Base, ProofScope} import org.shapesafe.m.viz.ExpressionVizCT import org.sh...
ithinkicancode/shapesafe
core/src/test/scala/org/shapesafe/core/shape/unary/ReorderSpec.scala
package org.shapesafe.core.shape.unary import org.shapesafe.graph.commons.util.viz.TypeViz import org.shapesafe.BaseSpec import org.shapesafe.core.arity.{Arity, ArityAPI} import org.shapesafe.core.shape.Index.Name import org.shapesafe.core.shape.{Indices, Names, Shape} import org.shapesafe.m.viz.TypeVizCT class Reord...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/binary/UncheckedDomain_Imp0.scala
package org.shapesafe.core.arity.binary import org.shapesafe.core.arity.Arity import org.shapesafe.core.arity.Unchecked import org.shapesafe.core.arity.ProveArity._ import scala.language.existentials trait UncheckedDomain_Imp0 { case class D2[ A1 <: Arity, A2 <: Arity, TC <: Arity ]()( i...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/axis/AxisLike.scala
package org.shapesafe.core.axis import org.shapesafe.core.arity.ArityAPI import org.shapesafe.core.arity.ops.HasArity import org.shapesafe.core.axis.Axis.:<<- import shapeless.Witness trait AxisLike extends HasArity { val nameSingleton: Witness.Lt[String] final type Name = nameSingleton.T final def name: Name...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/unary/ContractByName.scala
package org.shapesafe.core.shape.unary import org.shapesafe.core.arity.ops import org.shapesafe.core.arity.ops.ArityOps import org.shapesafe.core.shape.Shape import scala.language.implicitConversions // TODO: useless, EinSum handles every thing, remove? case class ContractByName[ S1 <: Shape ]( override val ...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/axis/RecordUpdater.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.axis import org.shapesafe.core.Poly1Base import org.shapesafe.core.axis.Axis.UB_->> import shapeless.HList trait RecordUpdater extends Poly1Base[(HList, UB_->>), HList] {}
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/axis/OldNameUpdaterSystem.scala
package org.shapesafe.core.axis import org.shapesafe.core.arity.binary.Op2Like import org.shapesafe.core.arity.{Arity, LeafArity} import org.shapesafe.core.axis.Axis.->> import shapeless.ops.record.{Modifier, Selector} import shapeless.syntax.RecordOps import shapeless.{::, HList, Witness} class OldNameUpdaterSystem[...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/unary/CheckDistinct.scala
package org.shapesafe.core.shape.unary import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{Expressions, OpStrs, Reporters} import org.shapesafe.core.shape.{LeafShape, ProveShape, Shape} import org.shapesafe.m.viz.VizCTSystem.EmitError // all names must be distinctive - no duplica...
ithinkicancode/shapesafe
macro/src/test/scala/org/shapesafe/m/EmitMsgSpec.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.m import org.shapesafe.graph.commons.testlib.BaseSpec import singleton.ops.ToString class EmitMsgSpec extends BaseSpec { import EmitMsgSpec._ it("weakly") { shouldNotCompile( """emitError.weakly["ABC"]""", "ABC" ) type RR = "ABC"...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/binary/DimensionWise.scala
package org.shapesafe.core.shape.binary import org.shapesafe.graph.commons.util.HasOuter import org.shapesafe.core.arity.Arity import org.shapesafe.core.arity.binary.Op2Like import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{DebugSymbol, Expressions, OpStrs} import org.shapesafe....
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/Propositional.scala
package org.shapesafe.core import scala.language.implicitConversions trait Propositional[OUB] { trait Term extends Serializable { type Domain <: OUB def value: Domain } case object Term { type Aux[O <: OUB] = Term { type Domain = O } type Lt[+O <: OUB] = Term { type Domain <...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/debugging/OpStrs.scala
package org.shapesafe.core.debugging import org.shapesafe.core.debugging.DebugUtil._ import singleton.ops.+ object OpStrs { type OpStr[T <: CanPeek] = StrOrRaw[ T#_AsOpStr ] // TODO: brackets? type Infix[T1 <: CanPeek, S, T2 <: CanPeek] = OpStr[T1] + StrOrRaw[S] + OpStr[T2] type PrefixW1[S, T <: ...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/util/Constraint.scala
package org.shapesafe.core.util import shapeless.HList import shapeless.ops.hlist import scala.language.implicitConversions trait Constraint {} object Constraint { import org.shapesafe.graph.commons.util.reflect.ScalaReflection._ // TODO: why reinventing the wheel? shapeless LUBConstraint is the same case c...
ithinkicancode/shapesafe
core/src/test/scala/org/shapesafe/core/RequireMsgSpike.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core import singleton.ops.RequireMsg object RequireMsgSpike { trait HasM { type M = Int } trait Foo[T] object Foo { implicit def ev[T <: HasM]( implicit r: RequireMsg[false, "Bad Type: ${T#M}"] ): Foo[T] = ??? } // im...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/axis/Axis.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.axis import org.shapesafe.graph.commons.util.IDMixin import org.shapesafe.core.arity.{Arity, ArityAPI} import org.shapesafe.core.debugging.Expressions.Expr import org.shapesafe.core.debugging.{CanPeek, DebugUtil, Expressions, OpStrs} import shapeless.Witnes...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/Unprovable.scala
package org.shapesafe.core.arity object Unprovable extends Arity { override def runtimeArity: Int = throw new UnsupportedOperationException(s"cannot verified an Unprovable") override type _AsExpr = "???" }
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/ArityConjecture.scala
package org.shapesafe.core.arity import org.shapesafe.graph.commons.util.ProductTree import org.shapesafe.core.debugging.DebugUtil.CanRefute trait ArityConjecture extends Arity.Verifiable with CanRefute with ProductTree { // final override def toString: String = treeString } object ArityConjecture {}
ithinkicancode/shapesafe
macro/src/main/scala/org/shapesafe/m/viz/KindVizCT.scala
<gh_stars>1-10 package org.shapesafe.m.viz import org.shapesafe.graph.commons.util.reflect.format.{EnableOvrd, Formats} import org.shapesafe.graph.commons.util.viz.TypeVizFormat import scala.language.experimental.macros case object KindVizCT extends VizCTSystem { override def format: TypeVizFormat = Formats.KindN...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/tuple/CanInfix_><.scala
package org.shapesafe.core.tuple import scala.language.implicitConversions trait CanInfix_>< extends CanCons { _self: TupleSystem => trait InfixMixin[SELF <: Tuple] { def self: SELF def ><[ HEAD <: UpperBound ]( head: HEAD )( implicit cons: Cons[SELF, HEAD] )...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/shape/ShapeConjecture.scala
package org.shapesafe.core.shape import org.shapesafe.graph.commons.util.ProductTree import org.shapesafe.core.debugging.DebugUtil.CanRefute trait ShapeConjecture extends Shape with CanRefute with ProductTree { final override def toString: String = treeString } object ShapeConjecture {}
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/ProofAPI.scala
<filename>core/src/main/scala/org/shapesafe/core/ProofAPI.scala<gh_stars>1-10 //package org.shapesafe.core // //import org.shapesafe.core.arity.ArityAPI //import org.shapesafe.core.debugging.{CanPeek, Reporters} // //trait ProofAPI { // // val scope: ProofScope // import scope._ // // final type VerifyTo = scope.OUB...
ithinkicancode/shapesafe
core/src/main/scala/org/shapesafe/core/arity/Arity.scala
<reponame>ithinkicancode/shapesafe package org.shapesafe.core.arity import org.shapesafe.core.arity import org.shapesafe.core.arity.ArityAPI.^ import org.shapesafe.core.arity.Const.{Derived, Literal} import org.shapesafe.core.arity.Utils.NatAsOp import org.shapesafe.core.debugging.CanPeek import shapeless.{Nat, Witnes...