thunk Questions

4

I tried all the commands for redux but it doesn't work:how do you think the solution is. These are the commands I tried yarn add react-redux yarn add reduxjs / Redux-thunk#master npm install --sav...
Existence asked 12/2, 2020 at 21:14

12

Solved

I've seen it used in programming (specifically in the C++ domain) and have no idea what it is. Presumably it is a design pattern, but I could be wrong. Can anyone give a good example of a thunk?
Footstone asked 14/4, 2010 at 22:23

1

Solved

I've following crash which occurs in live app, I can't reproduce it during development. Log is from Crashlytics. I can't figure out the reason for crash and how to fix. Any help? Crash Log Cr...
Chumley asked 25/4, 2020 at 17:4

2

Solved

I understand that both are functions that return functions. My experience so far with thunks have been using them to return functions as opposed to just action objects so that I can work with asy...

2

Solved

I am quite new to Haskell and I'm trying to wrap my head around how the lazy expression of Fibonacci sequences work. I know this has been asked before, but none of the answers have addressed an is...

1

Solved

My understanding is that foldl and foldr executes like : foldl f a [1..30] => (f (f (f ... (f a 1) 2) 3) ... 30) and foldr f a [1..30] => (f 1 (f 2 (f 3 (f ....(f 30 a)))))..) so.. foldr (&amp...
Pros asked 22/6, 2016 at 12:36

1

Solved

So I've been reading about the usage of the co library, and the general design pattern I've seen in most blog posts is wrapping functions that have callbacks in thunks. Then using an es6 generator ...
Herron asked 5/1, 2016 at 21:54

4

There are wiki articles about them: (http://en.wikipedia.org/wiki/Futures_and_promises, http://en.wikipedia.org/wiki/Thunk_(delayed_computation)). But I am not sure what are the exact differences b...
Retentivity asked 10/9, 2013 at 3:14

3

Solved

How does GHC handle thunks that are accessed by multiple threads (either explicit threads, or the internal ones that evaluate sparks)? Can it happen that multiple threads evaluate the same thunk, d...
Roselani asked 12/8, 2015 at 18:30

4

Solved

In Haskell, you can have infinite lists, because it doesn't completely compute them, it uses thunks. I am wondering if there is a way to serialize or otherwise save to a file a piece of data's thun...
Henigman asked 8/3, 2014 at 17:15

1

I've been playing with some examples from Simon Marlow's book about parallel and concurrent programming in Haskell and stumbled across an interesting behavior that I don't really understand. This i...
Parathion asked 15/7, 2014 at 10:20

4

In Haskell, is it possible to test if a value has been evaluated to weak head normal form? If a function already exists, I would expect it to have a signature like evaluated :: a -> IO Bool T...
Aribold asked 24/2, 2015 at 2:51

2

Solved

Here's a snippet of code that gives me a StackOverflowError (boiled down from an actual example in my codebase): ( ->> (range 3000) (mapcat #(concat [0] (take 100 (repeat %)))) (reduce (co...
Neptunium asked 16/10, 2014 at 5:15

1

Solved

I am wondering why :sprint reports xs = _ in this case: Prelude> xs = map (+1) [1..10] Prelude> length xs 10 Prelude> :sprint xs xs = _ but not in this case: Prelude> xs = map (+1) ...
Heal asked 3/2, 2014 at 1:41

2

I'm porting some Python code that relies heavily on delayed evaluation. This is accomplished by via thunks. More specifically, any Python expression <expr> for which delayed evaluation is des...
Torrid asked 30/8, 2013 at 20:51

1

Solved

I created this small program that creates a long-running thunk that eventually fails with an exception. Then, multiple threads try to evaluate it. import Control.Monad import Control.Concurrent im...
Bellbottoms asked 2/8, 2013 at 13:35

2

Solved

Let's say I have a very large number (millions/billions+) of these simple Foo data structures: data Foo = Foo { a :: {-# UNPACK #-}!Int , b :: Int } With so many of these floating around, it ...
Siclari asked 21/12, 2012 at 0:57

2

We have a large code base in C++ and after a smallish refactor (one class added and some related methods rewritten), we started getting linker errors on GCC 3 & 4. The linker errors were specif...
Heriot asked 14/4, 2011 at 15:36

5

Solved

What do the thunks for the following value/expression/function look like in the Haskell heap? val = 5 -- is `val` a pointer to a box containing 5? add x y = x + y result = add 2 val main = print...
Bohr asked 12/12, 2011 at 17:38

1

Solved

What is a thunk table in relation to the import address table that's used in EXE files to import functions used in external DLLs? Is this thunk table just a table containing 'Thunks' to other func...
Bosco asked 7/8, 2010 at 14:10

1

Solved

Can someone explain to me what a Thunk is? and an ATL Thunk? I know a thunk has something to do with the vtbl and execution of code to find the right function pointer. Am I right?
Refrigerator asked 25/7, 2010 at 14:22

2

Solved

I was reading some articles on net regarding Vtable thunks and I read somewhere that thunks can be used to hook /chain procedures calls. Is it achievable? Does anyone know how that works , also I...
Hoskins asked 7/7, 2009 at 6:58
1

© 2022 - 2024 — McMap. All rights reserved.