static-typing Questions
10
Solved
I'm just testing typescript in VisualStudio 2012 and have a problem with its type system. My html site has a canvas tag with the id "mycanvas". I'm trying to draw a rectangle on this canvas. Here's...
Gnni asked 2/12, 2012 at 12:46
4
Solved
Let's say I have the following data model, for keeping track of the stats of baseball players, teams, and coaches:
data BBTeam = BBTeam { teamname :: String,
manager :: Coach,
players :: [BBPla...
Avent asked 9/9, 2011 at 17:44
4
Solved
Question: Without using any, what is the proper typing for my onMouseMove function?
export class Main {
private dTimer: number;
constructor() {
this.init();
}
private init() {
this.mouseHan...
Demit asked 11/3, 2018 at 23:41
11
Solved
I wondered if there is a programming language which compiles to machine code/binary that features dynamic and/or weak typing (not bytecode then executed by a VM, that's something completely differe...
Pavis asked 31/3, 2010 at 17:24
19
Solved
What does it mean when we say a language is dynamically typed versus statically typed?
Cookshop asked 4/10, 2009 at 22:36
11
Solved
What is the difference between Static/Dynamic and Strong/Weak typing?
Hime asked 28/2, 2010 at 13:42
7
Solved
I'm coming from a statically-typed background and investigating functional programming, but I'm not entirely excited about dynamic typing. I'm curious about what kind of options are out there.
One ...
Limbic asked 16/11, 2011 at 5:53
2
Solved
I have this simple code in TypeScript:
abstract class Config {
readonly NAME: string;
readonly TITLE: string;
static CoreInterface: () => any
}
class Test implements Config {
readonly NAM...
Interlace asked 1/5, 2017 at 17:17
9
Solved
Also, does one imply the other?
Beatific asked 22/4, 2010 at 12:2
8
Solved
Recently I have been working with Typescript a lot, it allows to express things like:
interface Address {
street: string;
housenumber: number;
housenumberPostfix?: string;
}
interface Person {...
Lend asked 14/1, 2018 at 21:55
3
Solved
I'd like to be more explicit about my closures regarding their argument types. So I would write something like
List<Y> myCollect(List<X> list, Closure<X,Y> clos) { ... }
I know...
Crosley asked 15/4, 2011 at 19:46
1
Imagine, that I have class Foo with string identifier.
class Foo {
id = '123' as FooId;
}
I try to ensure static typing of it using a brand enum.
enum FooIdBranding {}
type FooId = string &am...
Voracious asked 7/5, 2019 at 10:17
1
Solved
In rust one explicitly types impl Trait for Object which guarantees that Object will have this trait. Now C++20 concepts are of course a bit more general as they are not associated to just one type...
Hypersensitive asked 5/5, 2021 at 18:30
7
Solved
I am looking for a Lua front-end compiler that is type-checked at compile time, but outputs standard Lua 5.1 byte-code (that has only run-time types). What I want is a decent amount of static, comp...
Venge asked 2/5, 2009 at 1:30
1
Solved
type MatchOperator = "==" | ">" | "<";
type Criteria<T, P extends keyof T> = {
field: P,
value: T[P],
operator: MatchOperator,
}
interface User {
name: string;
age: number;
id: ...
Donothingism asked 28/4, 2020 at 8:44
2
Solved
Is there any way to explicitly require in Julia (e.g. say within a module or package) that types must be declared? Does e.g. PackageCompiler or Lint.jl have any support for such checks? More broadl...
Homochromatic asked 30/12, 2019 at 15:7
1
Solved
For every example in the TypeScript generics documentation and in most type definition files I've came across, type variables are declared as a single letter, usually <T>.
Example:
function...
Korns asked 30/3, 2019 at 18:55
3
Solved
In short, you can just answer the part about identity, thanks. My main focus of this question is start from 2. about identity, I just tried to provide context/background of my current understanding...
Baltoslavic asked 23/11, 2018 at 8:43
1
Solved
I have made a function for doing optimization in python (let's call it optimizer). It requires the function to be optimized (let's call it objective) as one of the function arguments. objective is ...
Beaded asked 10/9, 2018 at 6:55
3
Solved
Just getting started with Flow but can't seem to understand what it wants me to do with adding types for destructuring objects like i.e. props
i.e.
render({ count }, { displayHelp }) {
Throws ...
Refine asked 10/4, 2017 at 16:19
4
Solved
To be honest I wasn't sure how to word this question so forgive me if the actual question isn't what you were expecting based on the title. C# is the first statically typed language I've ever progr...
Kirt asked 22/6, 2018 at 22:4
7
Solved
Simple question folks: I do a lot of programming (professionally and personally) in compiled languages like C++/Java and in interpreted languages like Python/Javascript. I personally find that my c...
Novia asked 8/9, 2009 at 13:0
2
Solved
I just added Flow to my Create-React-App project, and while converting some of my calculation code to flow-typed, I encountered this error with a destructured "object as params"
Original sig:
cal...
Nullity asked 12/1, 2018 at 18:3
2
Solved
Trying to use static types in Python code, so mypy can help me with some hidden errors. It's quite simple to use with single variables
real_hour: int = lower_hour + hour_iterator
Harder to use i...
Bulldozer asked 28/12, 2017 at 19:53
3
Solved
I have an object with typed keys, let's call them Statuses (StatusesType).
I need to iterate over the object and pass keys to some method expecting parameter of the same type StatusesType, let it b...
Fakieh asked 15/9, 2017 at 6:42
1 Next >
© 2022 - 2024 — McMap. All rights reserved.