Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
56 views

example (i:Fin 9)(h:(i.1/3 :Fin 3).1 = i/3): 0 = i.1/3:= by simp at h exact h This finishes the proof, but if i = 6, then h certainly is true. But the claim is 0 = i.1/3 <=> 0 = 2 either ...
4 votes
3 answers
101 views

console.log("12"+ {"x":"1",toString(){return 10;},valueOf(){return 90}}); In the above expression why toString() method is not called? As per the algorithm if either the left or right side there ...
9 votes
1 answer
146 views

Consider the minimally reproducible example: f = @(x) x f(end) Note, the MATLAB syntax highlighter doesn't actually highlight end in blue, showing that it is not parsing as a keyword, even though the ...
0 votes
1 answer
629 views

What does this error mean? Reproduction error[E0308]: mismatched types --> src/main.rs:50:35 | 50 | PaymentType::InvoiceIn => InvoiceIn { | ___________________________________^...
3 votes
1 answer
75 views

How to apply deref coercion from &mut to & for references that are wrapped inside Pin<>? That is, how to borrow Pin<&mut _> as Pin<&_>? use std::pin::{Pin, pin}; fn ...
0 votes
1 answer
103 views

(I am new to rust and trying to write a little card game as an exercise and I might not have grasped some things correctly. I am trying to break down my problem/confusion as much as I can.) I want to ...
Don's user avatar
  • 227
0 votes
2 answers
135 views

Say you have a matrix of logical values of size 6x4: set.seed(4) mat <- matrix(sample(c(T, F), 24, replace = T), ncol = 4) mat # [,1] [,2] [,3] [,4] # [1,] FALSE TRUE FALSE FALSE # [2,] ...
Dan Lewer's user avatar
  • 956
4 votes
2 answers
90 views

In GHC Haskell, Map k v has a type role declaration for k to be nominal. This is because the user can otherwise coerce k to another type with the same representation but different Ord instance, ...
0 votes
0 answers
61 views

I have some code that works fine, using Amplify to push and pull images from an AWS-S3 bucket. let uploadTask = Amplify.Storage.uploadData(key: imageKey, data: srcData, options: nil) Task { ...
0 votes
0 answers
80 views

So I just started learning about Rust and the Implicit Deref Coercion. A "problem" I now often tumble over, is that this automatic deref does not work inside of other types, e.g. as Item ...
2 votes
0 answers
256 views

In Rust, I have several different enums that are all #[repr(u32)], meaning I can use as to cast them to a u32: #[repr(u32)] enum Foo {A, B, C} fn f(foo: Foo) { dbg!(foo as u32); } Now I want to ...
0 votes
1 answer
470 views

I am reading the Book, YDKJS by Kyle Simpson, topic Coercion. While looking at the specs I found that ToPrimitive calls OrdinaryToPrimitive conditionally. I read in a blog that: JavaScript view ...
2 votes
1 answer
192 views

From The Rust Programming Language book: Deref coercion converts a reference to a type that implements the Deref trait into reference to another type Questions in code snippet below: Why & is ...
Ievgen's user avatar
  • 2,079
4 votes
1 answer
489 views

The behaviour of a Rust method call is described in The Rust Reference. It states that "when looking up a method call, the receiver may be automatically dereferenced or borrowed in order to call ...
0 votes
0 answers
285 views

Here I have a stripped down code snippet to demonstrate the sort of thing I'm trying to achieve: interface A<RequiresB extends boolean = true> { alwaysRequired: string b: RequiresB extends ...

15 30 50 per page
1
2 3 4 5
...
27

AltStyle によって変換されたページ (->オリジナル) /