Questions tagged [lifting]

a transformation of a function into a corresponding function in a more general context.

84 questions
1
vote
1 answer

Translating armv7m instructions to llvm IR

I am building a lifter that lifts from armv7m instructions to llvm IR. so I am trying to translate all armv7m instructions to their equivalent llvm instructions. I am new to llvm and I wanted to create and print an llvm instruction. So just starting…
hany erfan
  • 95
  • 7
1
vote
1 answer

Combining predicates in a functional way

Does Boost Hana provide a way to combine predicates with logical operators? I'm referring to something roughly like this constexpr auto both = [](auto&& f, auto&& g){ return [&f,&g](auto&& x){ return f(x) && g(x); }; }; that could be used like…
Enlico
  • 23,259
  • 6
  • 48
  • 102
1
vote
1 answer

Lift instance of class with a `MonadIO` type-variable to the transformed monad

As part of a program where I need to log data from monadic computations, I am trying to define a class to make this more convenient. module Serial where import Data.Int import Data.IORef import System.IO import Control.Monad.Trans import…
notBob
  • 143
  • 8
1
vote
2 answers

When and why to Lift a Function

Consider this code: def f1(a: Int, b: Int) = a + b def f2(a: Option[Int], b: Option[Int]): Int = (a, b) match { case (Some(x), Some(y)) => x + y case _ => throw new IllegalArgumentException } println(f1(10, 20)) println(f2(Some(10),…
finite_diffidence
  • 893
  • 2
  • 11
  • 20
1
vote
1 answer

REACT: Can´t pass parameter to a lifting up event handler

I can´t pass the parameters from a child component to a parent component using the same event handler. My components' tree follows this structure: ProductList ProductsGrid PaginationBar In the ProducList component I have this event…
Ricardo
  • 88
  • 1
  • 8
1
vote
1 answer

How to lift and compose functions together?

I have a list of people in this structure: const people = [ {name: 'jenny', friends: ['jeff']}, {name: 'frank', friends: ['jeff', 'ross']}, {name: 'sarah', friends: []}, {name: 'jeff', friends: ['jenny', 'frank']}, {name: 'russ', friends:…
Armeen Moon
  • 18,061
  • 35
  • 120
  • 233
1
vote
3 answers

F#: appending the value of an option to list option

I have a basic append function let append item list = item :: list And i have a' list option and option Some("something") let listOption = Some [] I want to add the value "something" to listOption. How can I do it without using pattern matching…
Tartar
  • 5,149
  • 16
  • 63
  • 104
1
vote
1 answer

Lifting a function

As a F# newbie, I am having problems with understanding the term "Lifting" and I can not properly lift a function. For example how can I lift the below function and how it will effect the functions behavior. let add item element = item ::…
Tartar
  • 5,149
  • 16
  • 63
  • 104
1
vote
1 answer

Gain/Lift chart interpretation using H2OFlow

The above image is the H2O GBM classification model lift chart for training and validation data sets. I am confused it with the other lift charts I have seen. Normally the baseline will be 45 degrees and the lift curve used to be somewhat convex…
Kitooos
  • 37
  • 7
1
vote
3 answers

Lifting up state in React

say i have this React Class. This is NOT my main component that I'm rendering. how can i pass the state i set in here UPWARDS to the parent component. class Player extends React.Component { constructor(props) { super(props); …
The Walrus
  • 1,148
  • 6
  • 28
  • 46
1
vote
1 answer

Does "Lifting" in functional programming follows strict rules?

I have looked into "lifting" q/a's, examples it seemed to me lift function is just like any transformation function that changes the shape (like monad transformation). Am I missing any point or lift function("lifting concept") does have any rules…
altayseyhan
  • 735
  • 1
  • 7
  • 18
1
vote
2 answers

Does a functor always return a lifted type in haskell when the fmap transformation is applied?

Let's say I have an Int and I apply fmap transformation using the Maybe as a functor, I get a wrapped type, i.e., Maybe Int. So can I consider this as lifting? If so does a functor always return a lifted type?
user235273
1
vote
2 answers

Using a pure function in a Haskell monad / left-lifting?

Consider the following function: foo = [1,2,3] >>= return . (*2) . (+1) For better readability and logic, I would like to move my pure functions (*2) and (+1) to the left of the return. I could achieve this like this: infixr 9 <. (<.) :: (a ->…
marc_r
  • 160
  • 7
1
vote
2 answers

scala lifting function having with a collection as argument

I have a class which accepts a function f: Option[Seq[Option[A]]] => Option[A]] case class Function[A](operator: Option[Seq[Option[A]]] => Option[A], name: String, arity: Int) What i would like is for the user of this class to be able to not have…
raul ferreira
  • 886
  • 7
  • 21
1
vote
2 answers

Partial lift for Monads?

Is there something like a partial lift for monads? I need the type signature to be this: Monad m => (a1 -> r) -> a1 -> m r Instead of this: Monad m => (a1 -> r) -> m a1 -> m r For use with >=> and other reasons. I'm looking for the canonical way…
antimatter
  • 3,240
  • 2
  • 23
  • 34